Always collect type and symbol baselines (#18621)

* Always generate type & symbol baselines

* Accept changed shadowed baselines

* Accept brand new type and symbol baselines

* Allow `getTypeAtLocation` to return undefined in the type writer

* Accept baselines which had missing type information

* Bind container for dynamically names enum members so they may be printed

* Accept type/symbol baselines for enums with computed members

* First pass at reducing typeWriter memory overhead

* Use generators to allow for type and symbol baselines with no cache

* Accept new baselines for tests whose output was fixed by better newline splitting

* Hard cap on number of declarations printed, cache declaration print text

* handle differing newlines better still to handle RWC newlines

* Lower abridging count, accept abridged baselines

* Limit max RWC error output size, limit RWC type and symbol baseline input size

* Move skip logic into type and symbol baseliner to streamline error handling

* Accept removal of empty baselines

* Canonicalize path earlier to handle odd paths in input files

* Do canonicalization earlier still, also ensure parallel perf profiles for different targets do not trample one another

* No need to pathify again
This commit is contained in:
Wesley Wigham 2017-09-22 15:52:04 -07:00 committed by GitHub
parent 92b7dcf20a
commit 5353475fce
8086 changed files with 672804 additions and 2181 deletions

2
.gitignore vendored
View file

@ -59,4 +59,4 @@ internal/
.idea
yarn.lock
package-lock.json
.parallelperf.json
.parallelperf.*

View file

@ -1456,11 +1456,6 @@ namespace ts {
}
function declareSymbolAndAddToSymbolTable(node: Declaration, symbolFlags: SymbolFlags, symbolExcludes: SymbolFlags): Symbol {
// Just call this directly so that the return type of this function stays "void".
return declareSymbolAndAddToSymbolTableWorker(node, symbolFlags, symbolExcludes);
}
function declareSymbolAndAddToSymbolTableWorker(node: Declaration, symbolFlags: SymbolFlags, symbolExcludes: SymbolFlags): Symbol {
switch (container.kind) {
// Modules, source files, and classes need specialized handling for how their
// members are declared (for example, a member of a class will go into a specific
@ -1683,6 +1678,9 @@ namespace ts {
function bindAnonymousDeclaration(node: Declaration, symbolFlags: SymbolFlags, name: __String) {
const symbol = createSymbol(symbolFlags, name);
if (symbolFlags & SymbolFlags.EnumMember) {
symbol.parent = container.symbol;
}
addDeclarationToSymbol(symbol, node, symbolFlags);
}

View file

@ -177,7 +177,7 @@ class CompilerBaselineRunner extends RunnerBase {
return;
}
Harness.Compiler.doTypeAndSymbolBaseline(justName, result, toBeCompiled.concat(otherFiles).filter(file => !!result.program.getSourceFile(file.unitName)));
Harness.Compiler.doTypeAndSymbolBaseline(justName, result.program, toBeCompiled.concat(otherFiles).filter(file => !!result.program.getSourceFile(file.unitName)));
});
});
}

View file

@ -148,6 +148,8 @@ namespace Utils {
});
}
export const canonicalizeForHarness = ts.createGetCanonicalFileName(/*caseSensitive*/ false); // This is done so tests work on windows _and_ linux
export function assertInvariants(node: ts.Node, parent: ts.Node): void {
if (node) {
assert.isFalse(node.pos < 0, "node.pos < 0");
@ -1446,10 +1448,7 @@ namespace Harness {
});
}
export function doTypeAndSymbolBaseline(baselinePath: string, result: CompilerResult, allFiles: {unitName: string, content: string}[], opts?: Harness.Baseline.BaselineOptions, multifile?: boolean) {
if (result.errors.length !== 0) {
return;
}
export function doTypeAndSymbolBaseline(baselinePath: string, program: ts.Program, allFiles: {unitName: string, content: string}[], opts?: Harness.Baseline.BaselineOptions, multifile?: boolean, skipTypeAndSymbolbaselines?: boolean) {
// The full walker simulates the types that you would get from doing a full
// compile. The pull walker simulates the types you get when you just do
// a type query for a random node (like how the LS would do it). Most of the
@ -1465,16 +1464,8 @@ namespace Harness {
// These types are equivalent, but depend on what order the compiler observed
// certain parts of the program.
const program = result.program;
const fullWalker = new TypeWriterWalker(program, /*fullTypeCheck*/ true);
const fullResults = ts.createMap<TypeWriterResult[]>();
for (const sourceFile of allFiles) {
fullResults.set(sourceFile.unitName, fullWalker.getTypeAndSymbols(sourceFile.unitName));
}
// Produce baselines. The first gives the types for all expressions.
// The second gives symbols for all identifiers.
let typesError: Error, symbolsError: Error;
@ -1515,76 +1506,77 @@ namespace Harness {
baselinePath.replace(/\.tsx?/, "") : baselinePath;
if (!multifile) {
const fullBaseLine = generateBaseLine(fullResults, isSymbolBaseLine);
const fullBaseLine = generateBaseLine(isSymbolBaseLine, skipTypeAndSymbolbaselines);
Harness.Baseline.runBaseline(outputFileName + fullExtension, () => fullBaseLine, opts);
}
else {
Harness.Baseline.runMultifileBaseline(outputFileName, fullExtension, () => {
return iterateBaseLine(fullResults, isSymbolBaseLine);
return iterateBaseLine(isSymbolBaseLine, skipTypeAndSymbolbaselines);
}, opts);
}
}
function generateBaseLine(typeWriterResults: ts.Map<TypeWriterResult[]>, isSymbolBaseline: boolean): string {
function generateBaseLine(isSymbolBaseline: boolean, skipTypeAndSymbolbaselines?: boolean): string {
let result = "";
const gen = iterateBaseLine(typeWriterResults, isSymbolBaseline);
const gen = iterateBaseLine(isSymbolBaseline, skipTypeAndSymbolbaselines);
for (let {done, value} = gen.next(); !done; { done, value } = gen.next()) {
const [, content] = value;
result += content;
}
return result;
/* tslint:disable:no-null-keyword */
return result || null;
/* tslint:enable:no-null-keyword */
}
function *iterateBaseLine(typeWriterResults: ts.Map<TypeWriterResult[]>, isSymbolBaseline: boolean): IterableIterator<[string, string]> {
let typeLines = "";
const typeMap: { [fileName: string]: { [lineNum: number]: string[]; } } = {};
function *iterateBaseLine(isSymbolBaseline: boolean, skipTypeAndSymbolbaselines?: boolean): IterableIterator<[string, string]> {
if (skipTypeAndSymbolbaselines) {
return;
}
const dupeCase = ts.createMap<number>();
for (const file of allFiles) {
const codeLines = file.content.split("\n");
const key = file.unitName;
typeWriterResults.get(file.unitName).forEach(result => {
const { unitName } = file;
let typeLines = "=== " + unitName + " ===\r\n";
const codeLines = ts.flatMap(file.content.split(/\r?\n/g), e => e.split(/[\r\u2028\u2029]/g));
const gen: IterableIterator<TypeWriterResult> = isSymbolBaseline ? fullWalker.getSymbols(unitName) : fullWalker.getTypes(unitName);
let lastIndexWritten: number | undefined;
for (let {done, value: result} = gen.next(); !done; { done, value: result } = gen.next()) {
if (isSymbolBaseline && !result.symbol) {
return;
}
if (lastIndexWritten === undefined) {
typeLines += codeLines.slice(0, result.line + 1).join("\r\n") + "\r\n";
}
else if (result.line !== lastIndexWritten) {
if (!((lastIndexWritten + 1 < codeLines.length) && (codeLines[lastIndexWritten + 1].match(/^\s*[{|}]\s*$/) || codeLines[lastIndexWritten + 1].trim() === ""))) {
typeLines += "\r\n";
}
typeLines += codeLines.slice(lastIndexWritten + 1, result.line + 1).join("\r\n") + "\r\n";
}
lastIndexWritten = result.line;
const typeOrSymbolString = isSymbolBaseline ? result.symbol : result.type;
const formattedLine = result.sourceText.replace(/\r?\n/g, "") + " : " + typeOrSymbolString;
if (!typeMap[key]) {
typeMap[key] = {};
}
typeLines += ">" + formattedLine + "\r\n";
}
let typeInfo = [formattedLine];
const existingTypeInfo = typeMap[key][result.line];
if (existingTypeInfo) {
typeInfo = existingTypeInfo.concat(typeInfo);
}
typeMap[key][result.line] = typeInfo;
});
typeLines += "=== " + file.unitName + " ===\r\n";
for (let i = 0; i < codeLines.length; i++) {
const currentCodeLine = codeLines[i];
typeLines += currentCodeLine + "\r\n";
if (typeMap[key]) {
const typeInfo = typeMap[key][i];
if (typeInfo) {
typeInfo.forEach(ty => {
typeLines += ">" + ty + "\r\n";
});
if (i + 1 < codeLines.length && (codeLines[i + 1].match(/^\s*[{|}]\s*$/) || codeLines[i + 1].trim() === "")) {
}
else {
typeLines += "\r\n";
}
}
}
else {
// Preserve legacy behavior
if (lastIndexWritten === undefined) {
for (let i = 0; i < codeLines.length; i++) {
const currentCodeLine = codeLines[i];
typeLines += currentCodeLine + "\r\n";
typeLines += "No type information for this code.";
}
}
yield [checkDuplicatedFileName(file.unitName, dupeCase), typeLines];
typeLines = "";
else {
if (lastIndexWritten + 1 < codeLines.length) {
if (!((lastIndexWritten + 1 < codeLines.length) && (codeLines[lastIndexWritten + 1].match(/^\s*[{|}]\s*$/) || codeLines[lastIndexWritten + 1].trim() === ""))) {
typeLines += "\r\n";
}
typeLines += codeLines.slice(lastIndexWritten + 1).join("\r\n");
}
typeLines += "\r\n";
}
yield [checkDuplicatedFileName(unitName, dupeCase), typeLines];
}
}
}
@ -1726,7 +1718,7 @@ namespace Harness {
}
function sanitizeTestFilePath(name: string) {
return ts.normalizeSlashes(name.replace(/[\^<>:"|?*%]/g, "_")).replace(/\.\.\//g, "__dotdot/").toLowerCase();
return ts.toPath(ts.normalizeSlashes(name.replace(/[\^<>:"|?*%]/g, "_")).replace(/\.\.\//g, "__dotdot/"), "", Utils.canonicalizeForHarness);
}
// This does not need to exist strictly speaking, but many tests will need to be updated if it's removed
@ -2070,7 +2062,6 @@ namespace Harness {
export function runMultifileBaseline(relativeFileBase: string, extension: string, generateContent: () => IterableIterator<[string, string, number]> | IterableIterator<[string, string]>, opts?: BaselineOptions, referencedExtensions?: string[]): void {
const gen = generateContent();
const writtenFiles = ts.createMap<true>();
const canonicalize = ts.createGetCanonicalFileName(/*caseSensitive*/ false); // This is done so tests work on windows _and_ linux
/* tslint:disable-next-line:no-null-keyword */
const errors: Error[] = [];
if (gen !== null) {
@ -2086,8 +2077,7 @@ namespace Harness {
catch (e) {
errors.push(e);
}
const path = ts.toPath(relativeFileName, "", canonicalize);
writtenFiles.set(path, true);
writtenFiles.set(relativeFileName, true);
}
}
@ -2100,8 +2090,7 @@ namespace Harness {
const missing: string[] = [];
for (const name of existing) {
const localCopy = name.substring(referenceDir.length - relativeFileBase.length);
const path = ts.toPath(localCopy, "", canonicalize);
if (!writtenFiles.has(path)) {
if (!writtenFiles.has(localCopy)) {
missing.push(localCopy);
}
}
@ -2114,13 +2103,14 @@ namespace Harness {
if (errors.length || missing.length) {
let errorMsg = "";
if (errors.length) {
errorMsg += `The baseline for ${relativeFileBase} has changed:${"\n " + errors.map(e => e.message).join("\n ")}`;
errorMsg += `The baseline for ${relativeFileBase} in ${errors.length} files has changed:${"\n " + errors.slice(0, 5).map(e => e.message).join("\n ") + (errors.length > 5 ? "\n" + ` and ${errors.length - 5} more` : "")}`;
}
if (errors.length && missing.length) {
errorMsg += "\n";
}
if (missing.length) {
errorMsg += `Baseline missing files:${"\n " + missing.join("\n ") + "\n"}Written:${"\n " + ts.arrayFrom(writtenFiles.keys()).join("\n ")}`;
const writtenFilesArray = ts.arrayFrom(writtenFiles.keys());
errorMsg += `Baseline missing ${missing.length} files:${"\n " + missing.slice(0, 5).join("\n ") + (missing.length > 5 ? "\n" + ` and ${missing.length - 5} more` : "") + "\n"}Written ${writtenFiles.size} files:${"\n " + writtenFilesArray.slice(0, 5).join("\n ") + (writtenFilesArray.length > 5 ? "\n" + ` and ${writtenFilesArray.length - 5} more` : "")}`;
}
throw new Error(errorMsg);
}

View file

@ -26,9 +26,12 @@ namespace Harness.Parallel.Host {
text?: string;
}
const perfdataFileName = ".parallelperf.json";
function readSavedPerfData(): {[testHash: string]: number} {
const perfDataContents = Harness.IO.readFile(perfdataFileName);
const perfdataFileNameFragment = ".parallelperf";
function perfdataFileName(target?: string) {
return `${perfdataFileNameFragment}${target ? `.${target}` : ""}.json`;
}
function readSavedPerfData(target?: string): {[testHash: string]: number} {
const perfDataContents = Harness.IO.readFile(perfdataFileName(target));
if (perfDataContents) {
return JSON.parse(perfDataContents);
}
@ -46,7 +49,7 @@ namespace Harness.Parallel.Host {
const { statSync }: { statSync(path: string): { size: number }; } = require("fs");
let tasks: { runner: TestRunnerKind, file: string, size: number }[] = [];
const newTasks: { runner: TestRunnerKind, file: string, size: number }[] = [];
const perfData = readSavedPerfData();
const perfData = readSavedPerfData(configOption);
let totalCost = 0;
let unknownValue: string | undefined;
for (const runner of runners) {
@ -290,7 +293,7 @@ namespace Harness.Parallel.Host {
reporter.epilogue();
}
Harness.IO.writeFile(perfdataFileName, JSON.stringify(newPerfData, null, 4)); // tslint:disable-line:no-null-keyword
Harness.IO.writeFile(perfdataFileName(configOption), JSON.stringify(newPerfData, null, 4)); // tslint:disable-line:no-null-keyword
process.exit(errorResults.length);
}

View file

@ -101,6 +101,7 @@ interface TaskSet {
files: string[];
}
let configOption: string;
function handleTestConfig() {
if (testConfigContent !== "") {
const testConfig = <TestConfig>JSON.parse(testConfigContent);
@ -136,6 +137,13 @@ function handleTestConfig() {
continue;
}
if (!configOption) {
configOption = option;
}
else {
configOption += "+" + option;
}
switch (option) {
case "compiler":
runners.push(new CompilerBaselineRunner(CompilerTestType.Conformance));

View file

@ -39,6 +39,8 @@ namespace RWC {
const baseName = /(.*)\/(.*).json/.exec(ts.normalizeSlashes(jsonPath))[2];
let currentDirectory: string;
let useCustomLibraryFile: boolean;
let skipTypeAndSymbolbaselines = false;
const typeAndSymbolSizeLimit = 10000000;
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.
@ -52,6 +54,7 @@ namespace RWC {
// or to use lib.d.ts inside the json object. If the flag is true, use the lib.d.ts inside json file
// otherwise use the lib.d.ts from built/local
useCustomLibraryFile = undefined;
skipTypeAndSymbolbaselines = false;
});
it("can compile", function(this: Mocha.ITestCallbackContext) {
@ -61,6 +64,7 @@ namespace RWC {
const ioLog: IOLog = JSON.parse(Harness.IO.readFile(jsonPath));
currentDirectory = ioLog.currentDirectory;
useCustomLibraryFile = ioLog.useCustomLibraryFile;
skipTypeAndSymbolbaselines = ioLog.filesRead.reduce((acc, elem) => (elem && elem.result && elem.result.contents) ? acc + elem.result.contents.length : acc, 0) > typeAndSymbolSizeLimit;
runWithIOLog(ioLog, () => {
opts = ts.parseCommandLine(ioLog.arguments, fileName => Harness.IO.readFile(fileName));
assert.equal(opts.errors.length, 0);
@ -217,10 +221,10 @@ namespace RWC {
it("has the expected types", () => {
// We don't need to pass the extension here because "doTypeAndSymbolBaseline" will append appropriate extension of ".types" or ".symbols"
Harness.Compiler.doTypeAndSymbolBaseline(baseName, compilerResult, inputFiles
Harness.Compiler.doTypeAndSymbolBaseline(baseName, compilerResult.program, inputFiles
.concat(otherFiles)
.filter(file => !!compilerResult.program.getSourceFile(file.unitName))
.filter(e => !Harness.isDefaultLibraryFile(e.unitName)), baselineOpts, /*multifile*/ true);
.filter(e => !Harness.isDefaultLibraryFile(e.unitName)), baselineOpts, /*multifile*/ true, skipTypeAndSymbolbaselines);
});
// Ideally, a generated declaration file will have no errors. But we allow generated

View file

@ -1,13 +1,26 @@
interface TypeWriterResult {
interface TypeWriterTypeResult {
line: number;
syntaxKind: number;
sourceText: string;
type: string;
}
interface TypeWriterSymbolResult {
line: number;
syntaxKind: number;
sourceText: string;
symbol: string;
}
interface TypeWriterResult {
line: number;
syntaxKind: number;
sourceText: string;
symbol?: string;
type?: string;
}
class TypeWriterWalker {
results: TypeWriterResult[];
currentSourceFile: ts.SourceFile;
private checker: ts.TypeChecker;
@ -20,57 +33,93 @@ class TypeWriterWalker {
: program.getTypeChecker();
}
public getTypeAndSymbols(fileName: string): TypeWriterResult[] {
public *getSymbols(fileName: string): IterableIterator<TypeWriterSymbolResult> {
const sourceFile = this.program.getSourceFile(fileName);
this.currentSourceFile = sourceFile;
this.results = [];
this.visitNode(sourceFile);
return this.results;
const gen = this.visitNode(sourceFile, /*isSymbolWalk*/ true);
for (let {done, value} = gen.next(); !done; { done, value } = gen.next()) {
yield value as TypeWriterSymbolResult;
}
}
private visitNode(node: ts.Node): void {
public *getTypes(fileName: string): IterableIterator<TypeWriterTypeResult> {
const sourceFile = this.program.getSourceFile(fileName);
this.currentSourceFile = sourceFile;
const gen = this.visitNode(sourceFile, /*isSymbolWalk*/ false);
for (let {done, value} = gen.next(); !done; { done, value } = gen.next()) {
yield value as TypeWriterTypeResult;
}
}
private *visitNode(node: ts.Node, isSymbolWalk: boolean): IterableIterator<TypeWriterResult> {
if (ts.isPartOfExpression(node) || node.kind === ts.SyntaxKind.Identifier) {
this.logTypeAndSymbol(node);
const result = this.writeTypeOrSymbol(node, isSymbolWalk);
if (result) {
yield result;
}
}
ts.forEachChild(node, child => this.visitNode(child));
const children: ts.Node[] = [];
ts.forEachChild(node, child => void children.push(child));
for (const child of children) {
const gen = this.visitNode(child, isSymbolWalk);
for (let {done, value} = gen.next(); !done; { done, value } = gen.next()) {
yield value;
}
}
}
private logTypeAndSymbol(node: ts.Node): void {
private writeTypeOrSymbol(node: ts.Node, isSymbolWalk: boolean): TypeWriterResult {
const actualPos = ts.skipTrivia(this.currentSourceFile.text, node.pos);
const lineAndCharacter = this.currentSourceFile.getLineAndCharacterOfPosition(actualPos);
const sourceText = ts.getTextOfNodeFromSourceText(this.currentSourceFile.text, node);
// Workaround to ensure we output 'C' instead of 'typeof C' for base class expressions
// let type = this.checker.getTypeAtLocation(node);
const type = node.parent && ts.isExpressionWithTypeArgumentsInClassExtendsClause(node.parent) && this.checker.getTypeAtLocation(node.parent) || this.checker.getTypeAtLocation(node);
ts.Debug.assert(type !== undefined, "type doesn't exist");
const symbol = this.checker.getSymbolAtLocation(node);
const typeString = this.checker.typeToString(type, node.parent, ts.TypeFormatFlags.NoTruncation);
let symbolString: string;
if (symbol) {
symbolString = "Symbol(" + this.checker.symbolToString(symbol, node.parent);
if (symbol.declarations) {
for (const declaration of symbol.declarations) {
symbolString += ", ";
const declSourceFile = declaration.getSourceFile();
const declLineAndCharacter = declSourceFile.getLineAndCharacterOfPosition(declaration.pos);
const fileName = ts.getBaseFileName(declSourceFile.fileName);
const isLibFile = /lib(.*)\.d\.ts/i.test(fileName);
symbolString += `Decl(${ fileName }, ${ isLibFile ? "--" : declLineAndCharacter.line }, ${ isLibFile ? "--" : declLineAndCharacter.character })`;
}
}
symbolString += ")";
if (!isSymbolWalk) {
// Workaround to ensure we output 'C' instead of 'typeof C' for base class expressions
// let type = this.checker.getTypeAtLocation(node);
const type = node.parent && ts.isExpressionWithTypeArgumentsInClassExtendsClause(node.parent) && this.checker.getTypeAtLocation(node.parent) || this.checker.getTypeAtLocation(node);
const typeString = type ? this.checker.typeToString(type, node.parent, ts.TypeFormatFlags.NoTruncation) : "No type information available!";
return {
line: lineAndCharacter.line,
syntaxKind: node.kind,
sourceText,
type: typeString
};
}
this.results.push({
const symbol = this.checker.getSymbolAtLocation(node);
if (!symbol) {
return;
}
let symbolString = "Symbol(" + this.checker.symbolToString(symbol, node.parent);
if (symbol.declarations) {
let count = 0;
for (const declaration of symbol.declarations) {
if (count >= 5) {
symbolString += ` ... and ${symbol.declarations.length - count} more`;
break;
}
count++;
symbolString += ", ";
if ((declaration as any)["__symbolTestOutputCache"]) {
symbolString += (declaration as any)["__symbolTestOutputCache"];
continue;
}
const declSourceFile = declaration.getSourceFile();
const declLineAndCharacter = declSourceFile.getLineAndCharacterOfPosition(declaration.pos);
const fileName = ts.getBaseFileName(declSourceFile.fileName);
const isLibFile = /lib(.*)\.d\.ts/i.test(fileName);
const declText = `Decl(${ fileName }, ${ isLibFile ? "--" : declLineAndCharacter.line }, ${ isLibFile ? "--" : declLineAndCharacter.character })`;
symbolString += declText;
(declaration as any)["__symbolTestOutputCache"] = declText;
}
}
symbolString += ")";
return {
line: lineAndCharacter.line,
syntaxKind: node.kind,
sourceText,
type: typeString,
symbol: symbolString
});
};
}
}

View file

@ -0,0 +1,6 @@
=== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArrowFunctions/ArrowFunction1.ts ===
var v = (a: ) => {
>v : Symbol(v, Decl(ArrowFunction1.ts, 0, 3))
>a : Symbol(a, Decl(ArrowFunction1.ts, 0, 9))
};

View file

@ -0,0 +1,8 @@
=== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArrowFunctions/ArrowFunction1.ts ===
var v = (a: ) => {
>v : (a: any) => void
>(a: ) => { } : (a: any) => void
>a : any
> : No type information available!
};

View file

@ -0,0 +1,6 @@
=== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArrowFunctions/ArrowFunction3.ts ===
var v = (a): => {
>v : Symbol(v, Decl(ArrowFunction3.ts, 0, 3))
>a : Symbol(a, Decl(ArrowFunction3.ts, 0, 9))
};

View file

@ -0,0 +1,8 @@
=== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArrowFunctions/ArrowFunction3.ts ===
var v = (a): => {
>v : (a: any) => any
>(a): => { } : (a: any) => any
>a : any
> : No type information available!
};

View file

@ -0,0 +1,5 @@
=== tests/cases/compiler/ArrowFunctionExpression1.ts ===
var v = (public x: string) => { };
>v : Symbol(v, Decl(ArrowFunctionExpression1.ts, 0, 3))
>x : Symbol(x, Decl(ArrowFunctionExpression1.ts, 0, 9))

View file

@ -0,0 +1,6 @@
=== tests/cases/compiler/ArrowFunctionExpression1.ts ===
var v = (public x: string) => { };
>v : (public x: string) => void
>(public x: string) => { } : (public x: string) => void
>x : string

View file

@ -0,0 +1,97 @@
=== tests/cases/conformance/internalModules/DeclarationMerging/ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts ===
// all expected to be errors
class clodule1<T>{
>clodule1 : Symbol(clodule1, Decl(ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts, 0, 0), Decl(ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts, 6, 1))
>T : Symbol(T, Decl(ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts, 2, 15))
id: string;
>id : Symbol(clodule1.id, Decl(ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts, 2, 18))
value: T;
>value : Symbol(clodule1.value, Decl(ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts, 4, 15))
>T : Symbol(T, Decl(ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts, 2, 15))
}
module clodule1 {
>clodule1 : Symbol(clodule1, Decl(ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts, 0, 0), Decl(ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts, 6, 1))
function f(x: T) { }
>f : Symbol(f, Decl(ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts, 8, 17))
>x : Symbol(x, Decl(ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts, 9, 15))
}
class clodule2<T>{
>clodule2 : Symbol(clodule2, Decl(ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts, 10, 1), Decl(ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts, 16, 1))
>T : Symbol(T, Decl(ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts, 12, 15))
id: string;
>id : Symbol(clodule2.id, Decl(ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts, 12, 18))
value: T;
>value : Symbol(clodule2.value, Decl(ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts, 14, 15))
>T : Symbol(T, Decl(ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts, 12, 15))
}
module clodule2 {
>clodule2 : Symbol(clodule2, Decl(ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts, 10, 1), Decl(ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts, 16, 1))
var x: T;
>x : Symbol(x, Decl(ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts, 19, 7))
class D<U extends T>{
>D : Symbol(D, Decl(ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts, 19, 13))
>U : Symbol(U, Decl(ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts, 21, 12))
id: string;
>id : Symbol(D.id, Decl(ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts, 21, 25))
value: U;
>value : Symbol(D.value, Decl(ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts, 22, 19))
>U : Symbol(U, Decl(ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts, 21, 12))
}
}
class clodule3<T>{
>clodule3 : Symbol(clodule3, Decl(ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts, 25, 1), Decl(ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts, 31, 1))
>T : Symbol(T, Decl(ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts, 27, 15))
id: string;
>id : Symbol(clodule3.id, Decl(ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts, 27, 18))
value: T;
>value : Symbol(clodule3.value, Decl(ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts, 29, 15))
>T : Symbol(T, Decl(ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts, 27, 15))
}
module clodule3 {
>clodule3 : Symbol(clodule3, Decl(ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts, 25, 1), Decl(ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts, 31, 1))
export var y = { id: T };
>y : Symbol(y, Decl(ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts, 34, 14))
>id : Symbol(id, Decl(ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts, 34, 20))
}
class clodule4<T>{
>clodule4 : Symbol(clodule4, Decl(ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts, 35, 1), Decl(ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts, 41, 1))
>T : Symbol(T, Decl(ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts, 37, 15))
id: string;
>id : Symbol(clodule4.id, Decl(ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts, 37, 18))
value: T;
>value : Symbol(clodule4.value, Decl(ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts, 39, 15))
>T : Symbol(T, Decl(ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts, 37, 15))
}
module clodule4 {
>clodule4 : Symbol(clodule4, Decl(ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts, 35, 1), Decl(ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts, 41, 1))
class D {
>D : Symbol(D, Decl(ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts, 43, 17))
name: T;
>name : Symbol(D.name, Decl(ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts, 44, 13))
}
}

View file

@ -0,0 +1,103 @@
=== tests/cases/conformance/internalModules/DeclarationMerging/ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts ===
// all expected to be errors
class clodule1<T>{
>clodule1 : clodule1<T>
>T : T
id: string;
>id : string
value: T;
>value : T
>T : T
}
module clodule1 {
>clodule1 : typeof clodule1
function f(x: T) { }
>f : (x: any) => void
>x : any
>T : No type information available!
}
class clodule2<T>{
>clodule2 : clodule2<T>
>T : T
id: string;
>id : string
value: T;
>value : T
>T : T
}
module clodule2 {
>clodule2 : typeof clodule2
var x: T;
>x : any
>T : No type information available!
class D<U extends T>{
>D : D<U>
>U : U
>T : No type information available!
id: string;
>id : string
value: U;
>value : U
>U : U
}
}
class clodule3<T>{
>clodule3 : clodule3<T>
>T : T
id: string;
>id : string
value: T;
>value : T
>T : T
}
module clodule3 {
>clodule3 : typeof clodule3
export var y = { id: T };
>y : { id: any; }
>{ id: T } : { id: any; }
>id : any
>T : any
}
class clodule4<T>{
>clodule4 : clodule4<T>
>T : T
id: string;
>id : string
value: T;
>value : T
>T : T
}
module clodule4 {
>clodule4 : typeof clodule4
class D {
>D : D
name: T;
>name : any
>T : No type information available!
}
}

View file

@ -0,0 +1,38 @@
=== tests/cases/conformance/internalModules/DeclarationMerging/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName.ts ===
class clodule<T> {
>clodule : Symbol(clodule, Decl(ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName.ts, 0, 0), Decl(ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName.ts, 5, 1))
>T : Symbol(T, Decl(ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName.ts, 0, 14))
id: string;
>id : Symbol(clodule.id, Decl(ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName.ts, 0, 18))
value: T;
>value : Symbol(clodule.value, Decl(ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName.ts, 1, 15))
>T : Symbol(T, Decl(ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName.ts, 0, 14))
static fn<U>(id: U) { }
>fn : Symbol(clodule.fn, Decl(ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName.ts, 2, 13))
>U : Symbol(U, Decl(ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName.ts, 4, 14))
>id : Symbol(id, Decl(ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName.ts, 4, 17))
>U : Symbol(U, Decl(ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName.ts, 4, 14))
}
module clodule {
>clodule : Symbol(clodule, Decl(ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName.ts, 0, 0), Decl(ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName.ts, 5, 1))
// error: duplicate identifier expected
export function fn<T>(x: T, y: T): T {
>fn : Symbol(clodule.fn, Decl(ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName.ts, 7, 16))
>T : Symbol(T, Decl(ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName.ts, 9, 23))
>x : Symbol(x, Decl(ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName.ts, 9, 26))
>T : Symbol(T, Decl(ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName.ts, 9, 23))
>y : Symbol(y, Decl(ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName.ts, 9, 31))
>T : Symbol(T, Decl(ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName.ts, 9, 23))
>T : Symbol(T, Decl(ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName.ts, 9, 23))
return x;
>x : Symbol(x, Decl(ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName.ts, 9, 26))
}
}

View file

@ -0,0 +1,38 @@
=== tests/cases/conformance/internalModules/DeclarationMerging/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName.ts ===
class clodule<T> {
>clodule : clodule<T>
>T : T
id: string;
>id : string
value: T;
>value : T
>T : T
static fn<U>(id: U) { }
>fn : <U>(id: U) => void
>U : U
>id : U
>U : U
}
module clodule {
>clodule : typeof clodule
// error: duplicate identifier expected
export function fn<T>(x: T, y: T): T {
>fn : <T>(x: T, y: T) => T
>T : T
>x : T
>T : T
>y : T
>T : T
>T : T
return x;
>x : T
}
}

View file

@ -0,0 +1,36 @@
=== tests/cases/conformance/internalModules/DeclarationMerging/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName.ts ===
class clodule<T> {
>clodule : Symbol(clodule, Decl(ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName.ts, 0, 0), Decl(ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName.ts, 5, 1))
>T : Symbol(T, Decl(ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName.ts, 0, 14))
id: string;
>id : Symbol(clodule.id, Decl(ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName.ts, 0, 18))
value: T;
>value : Symbol(clodule.value, Decl(ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName.ts, 1, 15))
>T : Symbol(T, Decl(ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName.ts, 0, 14))
static fn(id: string) { }
>fn : Symbol(clodule.fn, Decl(ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName.ts, 2, 13))
>id : Symbol(id, Decl(ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName.ts, 4, 14))
}
module clodule {
>clodule : Symbol(clodule, Decl(ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName.ts, 0, 0), Decl(ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName.ts, 5, 1))
// error: duplicate identifier expected
export function fn<T>(x: T, y: T): T {
>fn : Symbol(clodule.fn, Decl(ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName.ts, 7, 16))
>T : Symbol(T, Decl(ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName.ts, 9, 23))
>x : Symbol(x, Decl(ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName.ts, 9, 26))
>T : Symbol(T, Decl(ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName.ts, 9, 23))
>y : Symbol(y, Decl(ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName.ts, 9, 31))
>T : Symbol(T, Decl(ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName.ts, 9, 23))
>T : Symbol(T, Decl(ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName.ts, 9, 23))
return x;
>x : Symbol(x, Decl(ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName.ts, 9, 26))
}
}

View file

@ -0,0 +1,36 @@
=== tests/cases/conformance/internalModules/DeclarationMerging/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName.ts ===
class clodule<T> {
>clodule : clodule<T>
>T : T
id: string;
>id : string
value: T;
>value : T
>T : T
static fn(id: string) { }
>fn : (id: string) => void
>id : string
}
module clodule {
>clodule : typeof clodule
// error: duplicate identifier expected
export function fn<T>(x: T, y: T): T {
>fn : <T>(x: T, y: T) => T
>T : T
>x : T
>T : T
>y : T
>T : T
>T : T
return x;
>x : T
}
}

View file

@ -0,0 +1,37 @@
=== tests/cases/conformance/internalModules/DeclarationMerging/ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.ts ===
class clodule<T> {
>clodule : Symbol(clodule, Decl(ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.ts, 0, 0), Decl(ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.ts, 5, 1))
>T : Symbol(T, Decl(ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.ts, 0, 14))
id: string;
>id : Symbol(clodule.id, Decl(ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.ts, 0, 18))
value: T;
>value : Symbol(clodule.value, Decl(ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.ts, 1, 15))
>T : Symbol(T, Decl(ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.ts, 0, 14))
private static sfn(id: string) { return 42; }
>sfn : Symbol(clodule.sfn, Decl(ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.ts, 2, 13))
>id : Symbol(id, Decl(ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.ts, 4, 23))
}
module clodule {
>clodule : Symbol(clodule, Decl(ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.ts, 0, 0), Decl(ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.ts, 5, 1))
// error: duplicate identifier expected
export function fn<T>(x: T, y: T): number {
>fn : Symbol(fn, Decl(ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.ts, 7, 16))
>T : Symbol(T, Decl(ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.ts, 9, 23))
>x : Symbol(x, Decl(ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.ts, 9, 26))
>T : Symbol(T, Decl(ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.ts, 9, 23))
>y : Symbol(y, Decl(ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.ts, 9, 31))
>T : Symbol(T, Decl(ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.ts, 9, 23))
return clodule.sfn('a');
>clodule.sfn : Symbol(clodule.sfn, Decl(ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.ts, 2, 13))
>clodule : Symbol(clodule, Decl(ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.ts, 0, 0), Decl(ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.ts, 5, 1))
>sfn : Symbol(clodule.sfn, Decl(ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.ts, 2, 13))
}
}

View file

@ -0,0 +1,40 @@
=== tests/cases/conformance/internalModules/DeclarationMerging/ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.ts ===
class clodule<T> {
>clodule : clodule<T>
>T : T
id: string;
>id : string
value: T;
>value : T
>T : T
private static sfn(id: string) { return 42; }
>sfn : (id: string) => number
>id : string
>42 : 42
}
module clodule {
>clodule : typeof clodule
// error: duplicate identifier expected
export function fn<T>(x: T, y: T): number {
>fn : <T>(x: T, y: T) => number
>T : T
>x : T
>T : T
>y : T
>T : T
return clodule.sfn('a');
>clodule.sfn('a') : number
>clodule.sfn : (id: string) => number
>clodule : typeof clodule
>sfn : (id: string) => number
>'a' : "a"
}
}

View file

@ -0,0 +1,47 @@
=== tests/cases/conformance/internalModules/DeclarationMerging/ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.ts ===
class Point {
>Point : Symbol(Point, Decl(ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.ts, 0, 0), Decl(ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.ts, 4, 1))
constructor(public x: number, public y: number) { }
>x : Symbol(Point.x, Decl(ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.ts, 1, 16))
>y : Symbol(Point.y, Decl(ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.ts, 1, 33))
static Origin(): Point { return { x: 0, y: 0 }; } // unexpected error here bug 840246
>Origin : Symbol(Point.Origin, Decl(ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.ts, 1, 55))
>Point : Symbol(Point, Decl(ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.ts, 0, 0), Decl(ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.ts, 4, 1))
>x : Symbol(x, Decl(ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.ts, 3, 37))
>y : Symbol(y, Decl(ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.ts, 3, 43))
}
module Point {
>Point : Symbol(Point, Decl(ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.ts, 0, 0), Decl(ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.ts, 4, 1))
export function Origin() { return null; } //expected duplicate identifier error
>Origin : Symbol(Point.Origin, Decl(ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.ts, 6, 14))
}
module A {
>A : Symbol(A, Decl(ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.ts, 8, 1))
export class Point {
>Point : Symbol(Point, Decl(ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.ts, 11, 10), Decl(ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.ts, 16, 5))
constructor(public x: number, public y: number) { }
>x : Symbol(Point.x, Decl(ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.ts, 13, 20))
>y : Symbol(Point.y, Decl(ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.ts, 13, 37))
static Origin(): Point { return { x: 0, y: 0 }; } // unexpected error here bug 840246
>Origin : Symbol(Point.Origin, Decl(ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.ts, 13, 59))
>Point : Symbol(Point, Decl(ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.ts, 11, 10), Decl(ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.ts, 16, 5))
>x : Symbol(x, Decl(ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.ts, 15, 41))
>y : Symbol(y, Decl(ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.ts, 15, 47))
}
export module Point {
>Point : Symbol(Point, Decl(ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.ts, 11, 10), Decl(ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.ts, 16, 5))
export function Origin() { return ""; }//expected duplicate identifier error
>Origin : Symbol(Point.Origin, Decl(ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.ts, 18, 25))
}
}

View file

@ -0,0 +1,55 @@
=== tests/cases/conformance/internalModules/DeclarationMerging/ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.ts ===
class Point {
>Point : Point
constructor(public x: number, public y: number) { }
>x : number
>y : number
static Origin(): Point { return { x: 0, y: 0 }; } // unexpected error here bug 840246
>Origin : () => Point
>Point : Point
>{ x: 0, y: 0 } : { x: number; y: number; }
>x : number
>0 : 0
>y : number
>0 : 0
}
module Point {
>Point : typeof Point
export function Origin() { return null; } //expected duplicate identifier error
>Origin : () => any
>null : null
}
module A {
>A : typeof A
export class Point {
>Point : Point
constructor(public x: number, public y: number) { }
>x : number
>y : number
static Origin(): Point { return { x: 0, y: 0 }; } // unexpected error here bug 840246
>Origin : () => Point
>Point : Point
>{ x: 0, y: 0 } : { x: number; y: number; }
>x : number
>0 : 0
>y : number
>0 : 0
}
export module Point {
>Point : typeof Point
export function Origin() { return ""; }//expected duplicate identifier error
>Origin : () => string
>"" : ""
}
}

View file

@ -0,0 +1,47 @@
=== tests/cases/conformance/internalModules/DeclarationMerging/ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName.ts ===
class Point {
>Point : Symbol(Point, Decl(ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName.ts, 0, 0), Decl(ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName.ts, 4, 1))
constructor(public x: number, public y: number) { }
>x : Symbol(Point.x, Decl(ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName.ts, 1, 16))
>y : Symbol(Point.y, Decl(ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName.ts, 1, 33))
static Origin: Point = { x: 0, y: 0 };
>Origin : Symbol(Point.Origin, Decl(ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName.ts, 1, 55))
>Point : Symbol(Point, Decl(ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName.ts, 0, 0), Decl(ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName.ts, 4, 1))
>x : Symbol(x, Decl(ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName.ts, 3, 28))
>y : Symbol(y, Decl(ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName.ts, 3, 34))
}
module Point {
>Point : Symbol(Point, Decl(ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName.ts, 0, 0), Decl(ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName.ts, 4, 1))
export var Origin = ""; //expected duplicate identifier error
>Origin : Symbol(Point.Origin, Decl(ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName.ts, 7, 14))
}
module A {
>A : Symbol(A, Decl(ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName.ts, 8, 1))
export class Point {
>Point : Symbol(Point, Decl(ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName.ts, 11, 10), Decl(ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName.ts, 16, 5))
constructor(public x: number, public y: number) { }
>x : Symbol(Point.x, Decl(ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName.ts, 13, 20))
>y : Symbol(Point.y, Decl(ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName.ts, 13, 37))
static Origin: Point = { x: 0, y: 0 };
>Origin : Symbol(Point.Origin, Decl(ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName.ts, 13, 59))
>Point : Symbol(Point, Decl(ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName.ts, 11, 10), Decl(ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName.ts, 16, 5))
>x : Symbol(x, Decl(ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName.ts, 15, 32))
>y : Symbol(y, Decl(ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName.ts, 15, 38))
}
export module Point {
>Point : Symbol(Point, Decl(ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName.ts, 11, 10), Decl(ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName.ts, 16, 5))
export var Origin = ""; //expected duplicate identifier error
>Origin : Symbol(Point.Origin, Decl(ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName.ts, 19, 18))
}
}

View file

@ -0,0 +1,55 @@
=== tests/cases/conformance/internalModules/DeclarationMerging/ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName.ts ===
class Point {
>Point : Point
constructor(public x: number, public y: number) { }
>x : number
>y : number
static Origin: Point = { x: 0, y: 0 };
>Origin : Point
>Point : Point
>{ x: 0, y: 0 } : { x: number; y: number; }
>x : number
>0 : 0
>y : number
>0 : 0
}
module Point {
>Point : typeof Point
export var Origin = ""; //expected duplicate identifier error
>Origin : string
>"" : ""
}
module A {
>A : typeof A
export class Point {
>Point : Point
constructor(public x: number, public y: number) { }
>x : number
>y : number
static Origin: Point = { x: 0, y: 0 };
>Origin : Point
>Point : Point
>{ x: 0, y: 0 } : { x: number; y: number; }
>x : number
>0 : 0
>y : number
>0 : 0
}
export module Point {
>Point : typeof Point
export var Origin = ""; //expected duplicate identifier error
>Origin : string
>"" : ""
}
}

View file

@ -0,0 +1,98 @@
=== tests/cases/conformance/internalModules/DeclarationMerging/class.ts ===
module X.Y {
>X : Symbol(X, Decl(class.ts, 0, 0), Decl(module.ts, 0, 0))
>Y : Symbol(Y, Decl(class.ts, 0, 9), Decl(module.ts, 0, 9))
export class Point {
>Point : Symbol(Point, Decl(class.ts, 0, 12), Decl(module.ts, 0, 12))
constructor(x: number, y: number) {
>x : Symbol(x, Decl(class.ts, 2, 20))
>y : Symbol(y, Decl(class.ts, 2, 30))
this.x = x;
>this.x : Symbol(Point.x, Decl(class.ts, 5, 9))
>this : Symbol(Point, Decl(class.ts, 0, 12), Decl(module.ts, 0, 12))
>x : Symbol(Point.x, Decl(class.ts, 5, 9))
>x : Symbol(x, Decl(class.ts, 2, 20))
this.y = y;
>this.y : Symbol(Point.y, Decl(class.ts, 6, 18))
>this : Symbol(Point, Decl(class.ts, 0, 12), Decl(module.ts, 0, 12))
>y : Symbol(Point.y, Decl(class.ts, 6, 18))
>y : Symbol(y, Decl(class.ts, 2, 30))
}
x: number;
>x : Symbol(Point.x, Decl(class.ts, 5, 9))
y: number;
>y : Symbol(Point.y, Decl(class.ts, 6, 18))
}
}
=== tests/cases/conformance/internalModules/DeclarationMerging/module.ts ===
module X.Y {
>X : Symbol(X, Decl(class.ts, 0, 0), Decl(module.ts, 0, 0))
>Y : Symbol(Y, Decl(class.ts, 0, 9), Decl(module.ts, 0, 9))
export module Point {
>Point : Symbol(Point, Decl(class.ts, 0, 12), Decl(module.ts, 0, 12))
export var Origin = new Point(0, 0);
>Origin : Symbol(Origin, Decl(module.ts, 2, 18))
>Point : Symbol(Point, Decl(class.ts, 0, 12), Decl(module.ts, 0, 12))
}
}
=== tests/cases/conformance/internalModules/DeclarationMerging/test.ts ===
//var cl: { x: number; y: number; }
var cl = new X.Y.Point(1,1);
>cl : Symbol(cl, Decl(test.ts, 1, 3), Decl(test.ts, 2, 3))
>X.Y.Point : Symbol(X.Y.Point, Decl(class.ts, 0, 12), Decl(module.ts, 0, 12))
>X.Y : Symbol(X.Y, Decl(class.ts, 0, 9), Decl(module.ts, 0, 9))
>X : Symbol(X, Decl(class.ts, 0, 0), Decl(module.ts, 0, 0))
>Y : Symbol(X.Y, Decl(class.ts, 0, 9), Decl(module.ts, 0, 9))
>Point : Symbol(X.Y.Point, Decl(class.ts, 0, 12), Decl(module.ts, 0, 12))
var cl = X.Y.Point.Origin; // error not expected here same as bug 83996 ?
>cl : Symbol(cl, Decl(test.ts, 1, 3), Decl(test.ts, 2, 3))
>X.Y.Point.Origin : Symbol(X.Y.Point.Origin, Decl(module.ts, 2, 18))
>X.Y.Point : Symbol(X.Y.Point, Decl(class.ts, 0, 12), Decl(module.ts, 0, 12))
>X.Y : Symbol(X.Y, Decl(class.ts, 0, 9), Decl(module.ts, 0, 9))
>X : Symbol(X, Decl(class.ts, 0, 0), Decl(module.ts, 0, 0))
>Y : Symbol(X.Y, Decl(class.ts, 0, 9), Decl(module.ts, 0, 9))
>Point : Symbol(X.Y.Point, Decl(class.ts, 0, 12), Decl(module.ts, 0, 12))
>Origin : Symbol(X.Y.Point.Origin, Decl(module.ts, 2, 18))
=== tests/cases/conformance/internalModules/DeclarationMerging/simple.ts ===
class A {
>A : Symbol(A, Decl(simple.ts, 0, 0), Decl(simple.ts, 2, 1))
id: string;
>id : Symbol(A.id, Decl(simple.ts, 0, 9))
}
module A {
>A : Symbol(A, Decl(simple.ts, 0, 0), Decl(simple.ts, 2, 1))
export var Instance = new A();
>Instance : Symbol(Instance, Decl(simple.ts, 5, 14))
>A : Symbol(A, Decl(simple.ts, 0, 0), Decl(simple.ts, 2, 1))
}
// ensure merging works as expected
var a = A.Instance;
>a : Symbol(a, Decl(simple.ts, 9, 3), Decl(simple.ts, 10, 3), Decl(simple.ts, 11, 3))
>A.Instance : Symbol(A.Instance, Decl(simple.ts, 5, 14))
>A : Symbol(A, Decl(simple.ts, 0, 0), Decl(simple.ts, 2, 1))
>Instance : Symbol(A.Instance, Decl(simple.ts, 5, 14))
var a = new A();
>a : Symbol(a, Decl(simple.ts, 9, 3), Decl(simple.ts, 10, 3), Decl(simple.ts, 11, 3))
>A : Symbol(A, Decl(simple.ts, 0, 0), Decl(simple.ts, 2, 1))
var a: { id: string };
>a : Symbol(a, Decl(simple.ts, 9, 3), Decl(simple.ts, 10, 3), Decl(simple.ts, 11, 3))
>id : Symbol(id, Decl(simple.ts, 11, 8))

View file

@ -0,0 +1,108 @@
=== tests/cases/conformance/internalModules/DeclarationMerging/class.ts ===
module X.Y {
>X : typeof X
>Y : typeof Y
export class Point {
>Point : Point
constructor(x: number, y: number) {
>x : number
>y : number
this.x = x;
>this.x = x : number
>this.x : number
>this : this
>x : number
>x : number
this.y = y;
>this.y = y : number
>this.y : number
>this : this
>y : number
>y : number
}
x: number;
>x : number
y: number;
>y : number
}
}
=== tests/cases/conformance/internalModules/DeclarationMerging/module.ts ===
module X.Y {
>X : typeof X
>Y : typeof Y
export module Point {
>Point : typeof Point
export var Origin = new Point(0, 0);
>Origin : Point
>new Point(0, 0) : Point
>Point : typeof Point
>0 : 0
>0 : 0
}
}
=== tests/cases/conformance/internalModules/DeclarationMerging/test.ts ===
//var cl: { x: number; y: number; }
var cl = new X.Y.Point(1,1);
>cl : X.Y.Point
>new X.Y.Point(1,1) : X.Y.Point
>X.Y.Point : typeof X.Y.Point
>X.Y : typeof X.Y
>X : typeof X
>Y : typeof X.Y
>Point : typeof X.Y.Point
>1 : 1
>1 : 1
var cl = X.Y.Point.Origin; // error not expected here same as bug 83996 ?
>cl : X.Y.Point
>X.Y.Point.Origin : X.Y.Point
>X.Y.Point : typeof X.Y.Point
>X.Y : typeof X.Y
>X : typeof X
>Y : typeof X.Y
>Point : typeof X.Y.Point
>Origin : X.Y.Point
=== tests/cases/conformance/internalModules/DeclarationMerging/simple.ts ===
class A {
>A : A
id: string;
>id : string
}
module A {
>A : typeof A
export var Instance = new A();
>Instance : A
>new A() : A
>A : typeof A
}
// ensure merging works as expected
var a = A.Instance;
>a : A
>A.Instance : A
>A : typeof A
>Instance : A
var a = new A();
>a : A
>new A() : A
>A : typeof A
var a: { id: string };
>a : A
>id : string

View file

@ -0,0 +1,98 @@
=== tests/cases/conformance/internalModules/DeclarationMerging/class.ts ===
module X.Y {
>X : Symbol(X, Decl(class.ts, 0, 0), Decl(module.ts, 0, 0))
>Y : Symbol(Y, Decl(class.ts, 0, 9), Decl(module.ts, 0, 9))
export class Point {
>Point : Symbol(Point, Decl(class.ts, 0, 12), Decl(module.ts, 0, 12))
constructor(x: number, y: number) {
>x : Symbol(x, Decl(class.ts, 2, 20))
>y : Symbol(y, Decl(class.ts, 2, 30))
this.x = x;
>this.x : Symbol(Point.x, Decl(class.ts, 5, 9))
>this : Symbol(Point, Decl(class.ts, 0, 12), Decl(module.ts, 0, 12))
>x : Symbol(Point.x, Decl(class.ts, 5, 9))
>x : Symbol(x, Decl(class.ts, 2, 20))
this.y = y;
>this.y : Symbol(Point.y, Decl(class.ts, 6, 18))
>this : Symbol(Point, Decl(class.ts, 0, 12), Decl(module.ts, 0, 12))
>y : Symbol(Point.y, Decl(class.ts, 6, 18))
>y : Symbol(y, Decl(class.ts, 2, 30))
}
x: number;
>x : Symbol(Point.x, Decl(class.ts, 5, 9))
y: number;
>y : Symbol(Point.y, Decl(class.ts, 6, 18))
}
}
=== tests/cases/conformance/internalModules/DeclarationMerging/module.ts ===
module X.Y {
>X : Symbol(X, Decl(class.ts, 0, 0), Decl(module.ts, 0, 0))
>Y : Symbol(Y, Decl(class.ts, 0, 9), Decl(module.ts, 0, 9))
export module Point {
>Point : Symbol(Point, Decl(class.ts, 0, 12), Decl(module.ts, 0, 12))
export var Origin = new Point(0, 0);
>Origin : Symbol(Origin, Decl(module.ts, 2, 18))
>Point : Symbol(Point, Decl(class.ts, 0, 12), Decl(module.ts, 0, 12))
}
}
=== tests/cases/conformance/internalModules/DeclarationMerging/test.ts ===
//var cl: { x: number; y: number; }
var cl = new X.Y.Point(1,1);
>cl : Symbol(cl, Decl(test.ts, 1, 3), Decl(test.ts, 2, 3))
>X.Y.Point : Symbol(X.Y.Point, Decl(class.ts, 0, 12), Decl(module.ts, 0, 12))
>X.Y : Symbol(X.Y, Decl(class.ts, 0, 9), Decl(module.ts, 0, 9))
>X : Symbol(X, Decl(class.ts, 0, 0), Decl(module.ts, 0, 0))
>Y : Symbol(X.Y, Decl(class.ts, 0, 9), Decl(module.ts, 0, 9))
>Point : Symbol(X.Y.Point, Decl(class.ts, 0, 12), Decl(module.ts, 0, 12))
var cl = X.Y.Point.Origin; // error not expected here same as bug 83996 ?
>cl : Symbol(cl, Decl(test.ts, 1, 3), Decl(test.ts, 2, 3))
>X.Y.Point.Origin : Symbol(X.Y.Point.Origin, Decl(module.ts, 2, 18))
>X.Y.Point : Symbol(X.Y.Point, Decl(class.ts, 0, 12), Decl(module.ts, 0, 12))
>X.Y : Symbol(X.Y, Decl(class.ts, 0, 9), Decl(module.ts, 0, 9))
>X : Symbol(X, Decl(class.ts, 0, 0), Decl(module.ts, 0, 0))
>Y : Symbol(X.Y, Decl(class.ts, 0, 9), Decl(module.ts, 0, 9))
>Point : Symbol(X.Y.Point, Decl(class.ts, 0, 12), Decl(module.ts, 0, 12))
>Origin : Symbol(X.Y.Point.Origin, Decl(module.ts, 2, 18))
=== tests/cases/conformance/internalModules/DeclarationMerging/simple.ts ===
class A {
>A : Symbol(A, Decl(simple.ts, 0, 0), Decl(simple.ts, 2, 1))
id: string;
>id : Symbol(A.id, Decl(simple.ts, 0, 9))
}
module A {
>A : Symbol(A, Decl(simple.ts, 0, 0), Decl(simple.ts, 2, 1))
export var Instance = new A();
>Instance : Symbol(Instance, Decl(simple.ts, 5, 14))
>A : Symbol(A, Decl(simple.ts, 0, 0), Decl(simple.ts, 2, 1))
}
// ensure merging works as expected
var a = A.Instance;
>a : Symbol(a, Decl(simple.ts, 9, 3), Decl(simple.ts, 10, 3), Decl(simple.ts, 11, 3))
>A.Instance : Symbol(A.Instance, Decl(simple.ts, 5, 14))
>A : Symbol(A, Decl(simple.ts, 0, 0), Decl(simple.ts, 2, 1))
>Instance : Symbol(A.Instance, Decl(simple.ts, 5, 14))
var a = new A();
>a : Symbol(a, Decl(simple.ts, 9, 3), Decl(simple.ts, 10, 3), Decl(simple.ts, 11, 3))
>A : Symbol(A, Decl(simple.ts, 0, 0), Decl(simple.ts, 2, 1))
var a: { id: string };
>a : Symbol(a, Decl(simple.ts, 9, 3), Decl(simple.ts, 10, 3), Decl(simple.ts, 11, 3))
>id : Symbol(id, Decl(simple.ts, 11, 8))

View file

@ -0,0 +1,108 @@
=== tests/cases/conformance/internalModules/DeclarationMerging/class.ts ===
module X.Y {
>X : typeof X
>Y : typeof Y
export class Point {
>Point : Point
constructor(x: number, y: number) {
>x : number
>y : number
this.x = x;
>this.x = x : number
>this.x : number
>this : this
>x : number
>x : number
this.y = y;
>this.y = y : number
>this.y : number
>this : this
>y : number
>y : number
}
x: number;
>x : number
y: number;
>y : number
}
}
=== tests/cases/conformance/internalModules/DeclarationMerging/module.ts ===
module X.Y {
>X : typeof X
>Y : typeof Y
export module Point {
>Point : typeof Point
export var Origin = new Point(0, 0);
>Origin : Point
>new Point(0, 0) : Point
>Point : typeof Point
>0 : 0
>0 : 0
}
}
=== tests/cases/conformance/internalModules/DeclarationMerging/test.ts ===
//var cl: { x: number; y: number; }
var cl = new X.Y.Point(1,1);
>cl : X.Y.Point
>new X.Y.Point(1,1) : X.Y.Point
>X.Y.Point : typeof X.Y.Point
>X.Y : typeof X.Y
>X : typeof X
>Y : typeof X.Y
>Point : typeof X.Y.Point
>1 : 1
>1 : 1
var cl = X.Y.Point.Origin; // error not expected here same as bug 83996 ?
>cl : X.Y.Point
>X.Y.Point.Origin : X.Y.Point
>X.Y.Point : typeof X.Y.Point
>X.Y : typeof X.Y
>X : typeof X
>Y : typeof X.Y
>Point : typeof X.Y.Point
>Origin : X.Y.Point
=== tests/cases/conformance/internalModules/DeclarationMerging/simple.ts ===
class A {
>A : A
id: string;
>id : string
}
module A {
>A : typeof A
export var Instance = new A();
>Instance : A
>new A() : A
>A : typeof A
}
// ensure merging works as expected
var a = A.Instance;
>a : A
>A.Instance : A
>A : typeof A
>Instance : A
var a = new A();
>a : A
>new A() : A
>A : typeof A
var a: { id: string };
>a : A
>id : string

View file

@ -0,0 +1,8 @@
=== tests/cases/compiler/ClassDeclaration10.ts ===
class C {
>C : Symbol(C, Decl(ClassDeclaration10.ts, 0, 0))
constructor();
foo();
>foo : Symbol(C.foo, Decl(ClassDeclaration10.ts, 1, 17))
}

View file

@ -0,0 +1,8 @@
=== tests/cases/compiler/ClassDeclaration10.ts ===
class C {
>C : C
constructor();
foo();
>foo : () => any
}

View file

@ -0,0 +1,8 @@
=== tests/cases/compiler/ClassDeclaration11.ts ===
class C {
>C : Symbol(C, Decl(ClassDeclaration11.ts, 0, 0))
constructor();
foo() { }
>foo : Symbol(C.foo, Decl(ClassDeclaration11.ts, 1, 17))
}

View file

@ -0,0 +1,8 @@
=== tests/cases/compiler/ClassDeclaration11.ts ===
class C {
>C : C
constructor();
foo() { }
>foo : () => void
}

View file

@ -0,0 +1,10 @@
=== tests/cases/compiler/ClassDeclaration13.ts ===
class C {
>C : Symbol(C, Decl(ClassDeclaration13.ts, 0, 0))
foo();
>foo : Symbol(C.foo, Decl(ClassDeclaration13.ts, 0, 9))
bar() { }
>bar : Symbol(C.bar, Decl(ClassDeclaration13.ts, 1, 9))
}

View file

@ -0,0 +1,10 @@
=== tests/cases/compiler/ClassDeclaration13.ts ===
class C {
>C : C
foo();
>foo : () => any
bar() { }
>bar : () => void
}

View file

@ -0,0 +1,9 @@
=== tests/cases/compiler/ClassDeclaration14.ts ===
class C {
>C : Symbol(C, Decl(ClassDeclaration14.ts, 0, 0))
foo();
>foo : Symbol(C.foo, Decl(ClassDeclaration14.ts, 0, 9))
constructor();
}

View file

@ -0,0 +1,9 @@
=== tests/cases/compiler/ClassDeclaration14.ts ===
class C {
>C : C
foo();
>foo : () => any
constructor();
}

View file

@ -0,0 +1,9 @@
=== tests/cases/compiler/ClassDeclaration15.ts ===
class C {
>C : Symbol(C, Decl(ClassDeclaration15.ts, 0, 0))
foo();
>foo : Symbol(C.foo, Decl(ClassDeclaration15.ts, 0, 9))
constructor() { }
}

View file

@ -0,0 +1,9 @@
=== tests/cases/compiler/ClassDeclaration15.ts ===
class C {
>C : C
foo();
>foo : () => any
constructor() { }
}

View file

@ -0,0 +1,7 @@
=== tests/cases/compiler/ClassDeclaration21.ts ===
class C {
>C : Symbol(C, Decl(ClassDeclaration21.ts, 0, 0))
0();
1() { }
}

View file

@ -0,0 +1,7 @@
=== tests/cases/compiler/ClassDeclaration21.ts ===
class C {
>C : C
0();
1() { }
}

View file

@ -0,0 +1,7 @@
=== tests/cases/compiler/ClassDeclaration22.ts ===
class C {
>C : Symbol(C, Decl(ClassDeclaration22.ts, 0, 0))
"foo"();
"bar"() { }
}

View file

@ -0,0 +1,7 @@
=== tests/cases/compiler/ClassDeclaration22.ts ===
class C {
>C : C
"foo"();
"bar"() { }
}

View file

@ -0,0 +1,4 @@
=== tests/cases/compiler/ClassDeclaration24.ts ===
class any {
>any : Symbol(any, Decl(ClassDeclaration24.ts, 0, 0))
}

View file

@ -0,0 +1,4 @@
=== tests/cases/compiler/ClassDeclaration24.ts ===
class any {
>any : any
}

View file

@ -0,0 +1,26 @@
=== tests/cases/compiler/ClassDeclaration25.ts ===
interface IList<T> {
>IList : Symbol(IList, Decl(ClassDeclaration25.ts, 0, 0))
>T : Symbol(T, Decl(ClassDeclaration25.ts, 0, 16))
data(): T;
>data : Symbol(IList.data, Decl(ClassDeclaration25.ts, 0, 20))
>T : Symbol(T, Decl(ClassDeclaration25.ts, 0, 16))
next(): string;
>next : Symbol(IList.next, Decl(ClassDeclaration25.ts, 1, 14))
}
class List<U> implements IList<U> {
>List : Symbol(List, Decl(ClassDeclaration25.ts, 3, 1))
>U : Symbol(U, Decl(ClassDeclaration25.ts, 4, 11))
>IList : Symbol(IList, Decl(ClassDeclaration25.ts, 0, 0))
>U : Symbol(U, Decl(ClassDeclaration25.ts, 4, 11))
data(): U;
>data : Symbol(List.data, Decl(ClassDeclaration25.ts, 4, 35))
>U : Symbol(U, Decl(ClassDeclaration25.ts, 4, 11))
next(): string;
>next : Symbol(List.next, Decl(ClassDeclaration25.ts, 5, 14))
}

View file

@ -0,0 +1,26 @@
=== tests/cases/compiler/ClassDeclaration25.ts ===
interface IList<T> {
>IList : IList<T>
>T : T
data(): T;
>data : () => T
>T : T
next(): string;
>next : () => string
}
class List<U> implements IList<U> {
>List : List<U>
>U : U
>IList : IList<T>
>U : U
data(): U;
>data : () => U
>U : U
next(): string;
>next : () => string
}

View file

@ -0,0 +1,11 @@
=== tests/cases/compiler/ClassDeclaration26.ts ===
class C {
>C : Symbol(C, Decl(ClassDeclaration26.ts, 0, 0))
public const var export foo = 10;
>var : Symbol(C.var, Decl(ClassDeclaration26.ts, 0, 9))
>foo : Symbol(C.foo, Decl(ClassDeclaration26.ts, 1, 20))
var constructor() { }
>constructor : Symbol(constructor, Decl(ClassDeclaration26.ts, 3, 7))
}

View file

@ -0,0 +1,13 @@
=== tests/cases/compiler/ClassDeclaration26.ts ===
class C {
>C : C
public const var export foo = 10;
>var : any
>foo : number
>10 : 10
var constructor() { }
>constructor : () => void
>() { } : () => void
}

View file

@ -0,0 +1,6 @@
=== tests/cases/compiler/ClassDeclaration8.ts ===
class C {
>C : Symbol(C, Decl(ClassDeclaration8.ts, 0, 0))
constructor();
}

View file

@ -0,0 +1,6 @@
=== tests/cases/compiler/ClassDeclaration8.ts ===
class C {
>C : C
constructor();
}

View file

@ -0,0 +1,7 @@
=== tests/cases/compiler/ClassDeclaration9.ts ===
class C {
>C : Symbol(C, Decl(ClassDeclaration9.ts, 0, 0))
foo();
>foo : Symbol(C.foo, Decl(ClassDeclaration9.ts, 0, 9))
}

View file

@ -0,0 +1,7 @@
=== tests/cases/compiler/ClassDeclaration9.ts ===
class C {
>C : C
foo();
>foo : () => any
}

View file

@ -0,0 +1,7 @@
=== tests/cases/compiler/ClassDeclarationWithInvalidConstOnPropertyDeclaration.ts ===
class AtomicNumbers {
>AtomicNumbers : Symbol(AtomicNumbers, Decl(ClassDeclarationWithInvalidConstOnPropertyDeclaration.ts, 0, 0))
static const H = 1;
>H : Symbol(AtomicNumbers.H, Decl(ClassDeclarationWithInvalidConstOnPropertyDeclaration.ts, 0, 21))
}

View file

@ -0,0 +1,8 @@
=== tests/cases/compiler/ClassDeclarationWithInvalidConstOnPropertyDeclaration.ts ===
class AtomicNumbers {
>AtomicNumbers : AtomicNumbers
static const H = 1;
>H : number
>1 : 1
}

View file

@ -0,0 +1,12 @@
=== tests/cases/compiler/DeclarationErrorsNoEmitOnError.ts ===
type T = { x : number }
>T : Symbol(T, Decl(DeclarationErrorsNoEmitOnError.ts, 0, 0))
>x : Symbol(x, Decl(DeclarationErrorsNoEmitOnError.ts, 0, 10))
export interface I {
>I : Symbol(I, Decl(DeclarationErrorsNoEmitOnError.ts, 0, 23))
f: T;
>f : Symbol(I.f, Decl(DeclarationErrorsNoEmitOnError.ts, 1, 20))
>T : Symbol(T, Decl(DeclarationErrorsNoEmitOnError.ts, 0, 0))
}

View file

@ -0,0 +1,12 @@
=== tests/cases/compiler/DeclarationErrorsNoEmitOnError.ts ===
type T = { x : number }
>T : { x: number; }
>x : number
export interface I {
>I : I
f: T;
>f : { x: number; }
>T : { x: number; }
}

View file

@ -0,0 +1,4 @@
=== tests/cases/conformance/statements/for-ofStatements/ES3For-ofTypeCheck1.ts ===
for (var v of "") { }
>v : Symbol(v, Decl(ES3For-ofTypeCheck1.ts, 0, 8))

View file

@ -0,0 +1,5 @@
=== tests/cases/conformance/statements/for-ofStatements/ES3For-ofTypeCheck1.ts ===
for (var v of "") { }
>v : string
>"" : ""

View file

@ -0,0 +1,8 @@
=== tests/cases/conformance/statements/for-ofStatements/ES3For-ofTypeCheck4.ts ===
var union: string | string[];
>union : Symbol(union, Decl(ES3For-ofTypeCheck4.ts, 0, 3))
for (const v of union) { }
>v : Symbol(v, Decl(ES3For-ofTypeCheck4.ts, 1, 10))
>union : Symbol(union, Decl(ES3For-ofTypeCheck4.ts, 0, 3))

View file

@ -0,0 +1,8 @@
=== tests/cases/conformance/statements/for-ofStatements/ES3For-ofTypeCheck4.ts ===
var union: string | string[];
>union : string | string[]
for (const v of union) { }
>v : string
>union : string | string[]

View file

@ -0,0 +1,7 @@
=== tests/cases/conformance/statements/for-ofStatements/ES5For-of1.ts ===
for (var v of ['a', 'b', 'c']) {
>v : Symbol(v, Decl(ES5For-of1.ts, 0, 8))
console.log(v);
>v : Symbol(v, Decl(ES5For-of1.ts, 0, 8))
}

View file

@ -0,0 +1,15 @@
=== tests/cases/conformance/statements/for-ofStatements/ES5For-of1.ts ===
for (var v of ['a', 'b', 'c']) {
>v : string
>['a', 'b', 'c'] : string[]
>'a' : "a"
>'b' : "b"
>'c' : "c"
console.log(v);
>console.log(v) : any
>console.log : any
>console : any
>log : any
>v : string
}

View file

@ -0,0 +1,3 @@
=== tests/cases/conformance/statements/for-ofStatements/ES5For-of12.ts ===
for ([""] of [[""]]) { }
No type information for this code.

View file

@ -0,0 +1,8 @@
=== tests/cases/conformance/statements/for-ofStatements/ES5For-of12.ts ===
for ([""] of [[""]]) { }
>[""] : [string]
>"" : ""
>[[""]] : string[][]
>[""] : string[]
>"" : ""

View file

@ -0,0 +1,19 @@
=== tests/cases/conformance/statements/for-ofStatements/ES5For-of17.ts ===
for (let v of []) {
>v : Symbol(v, Decl(ES5For-of17.ts, 0, 8))
v;
>v : Symbol(v, Decl(ES5For-of17.ts, 0, 8))
for (let v of [v]) {
>v : Symbol(v, Decl(ES5For-of17.ts, 2, 12))
>v : Symbol(v, Decl(ES5For-of17.ts, 2, 12))
var x = v;
>x : Symbol(x, Decl(ES5For-of17.ts, 3, 11))
>v : Symbol(v, Decl(ES5For-of17.ts, 2, 12))
v++;
>v : Symbol(v, Decl(ES5For-of17.ts, 2, 12))
}
}

View file

@ -0,0 +1,22 @@
=== tests/cases/conformance/statements/for-ofStatements/ES5For-of17.ts ===
for (let v of []) {
>v : any
>[] : undefined[]
v;
>v : any
for (let v of [v]) {
>v : any
>[v] : any[]
>v : any
var x = v;
>x : any
>v : any
v++;
>v++ : number
>v : any
}
}

View file

@ -0,0 +1,15 @@
=== tests/cases/conformance/statements/for-ofStatements/ES5For-of20.ts ===
for (let v of []) {
>v : Symbol(v, Decl(ES5For-of20.ts, 0, 8))
let v;
>v : Symbol(v, Decl(ES5For-of20.ts, 1, 7))
for (let v of [v]) {
>v : Symbol(v, Decl(ES5For-of20.ts, 2, 12))
>v : Symbol(v, Decl(ES5For-of20.ts, 2, 12))
const v;
>v : Symbol(v, Decl(ES5For-of20.ts, 3, 13))
}
}

View file

@ -0,0 +1,17 @@
=== tests/cases/conformance/statements/for-ofStatements/ES5For-of20.ts ===
for (let v of []) {
>v : any
>[] : undefined[]
let v;
>v : any
for (let v of [v]) {
>v : any
>[v] : any[]
>v : any
const v;
>v : any
}
}

View file

@ -0,0 +1,10 @@
=== tests/cases/conformance/statements/for-ofStatements/ES5For-of22.ts ===
for (var x of [1, 2, 3]) {
>x : Symbol(x, Decl(ES5For-of22.ts, 0, 8))
let _a = 0;
>_a : Symbol(_a, Decl(ES5For-of22.ts, 1, 7))
console.log(x);
>x : Symbol(x, Decl(ES5For-of22.ts, 0, 8))
}

View file

@ -0,0 +1,19 @@
=== tests/cases/conformance/statements/for-ofStatements/ES5For-of22.ts ===
for (var x of [1, 2, 3]) {
>x : number
>[1, 2, 3] : number[]
>1 : 1
>2 : 2
>3 : 3
let _a = 0;
>_a : number
>0 : 0
console.log(x);
>console.log(x) : any
>console.log : any
>console : any
>log : any
>x : number
}

View file

@ -0,0 +1,10 @@
=== tests/cases/conformance/statements/for-ofStatements/ES5For-of23.ts ===
for (var x of [1, 2, 3]) {
>x : Symbol(x, Decl(ES5For-of23.ts, 0, 8))
var _a = 0;
>_a : Symbol(_a, Decl(ES5For-of23.ts, 1, 7))
console.log(x);
>x : Symbol(x, Decl(ES5For-of23.ts, 0, 8))
}

View file

@ -0,0 +1,19 @@
=== tests/cases/conformance/statements/for-ofStatements/ES5For-of23.ts ===
for (var x of [1, 2, 3]) {
>x : number
>[1, 2, 3] : number[]
>1 : 1
>2 : 2
>3 : 3
var _a = 0;
>_a : number
>0 : 0
console.log(x);
>console.log(x) : any
>console.log : any
>console : any
>log : any
>x : number
}

View file

@ -0,0 +1,11 @@
=== tests/cases/conformance/statements/for-ofStatements/ES5For-of26.ts ===
for (var [a = 0, b = 1] of [2, 3]) {
>a : Symbol(a, Decl(ES5For-of26.ts, 0, 10))
>b : Symbol(b, Decl(ES5For-of26.ts, 0, 16))
a;
>a : Symbol(a, Decl(ES5For-of26.ts, 0, 10))
b;
>b : Symbol(b, Decl(ES5For-of26.ts, 0, 16))
}

View file

@ -0,0 +1,16 @@
=== tests/cases/conformance/statements/for-ofStatements/ES5For-of26.ts ===
for (var [a = 0, b = 1] of [2, 3]) {
>a : any
>0 : 0
>b : any
>1 : 1
>[2, 3] : number[]
>2 : 2
>3 : 3
a;
>a : any
b;
>b : any
}

View file

@ -0,0 +1,11 @@
=== tests/cases/conformance/statements/for-ofStatements/ES5For-of27.ts ===
for (var {x: a = 0, y: b = 1} of [2, 3]) {
>a : Symbol(a, Decl(ES5For-of27.ts, 0, 10))
>b : Symbol(b, Decl(ES5For-of27.ts, 0, 19))
a;
>a : Symbol(a, Decl(ES5For-of27.ts, 0, 10))
b;
>b : Symbol(b, Decl(ES5For-of27.ts, 0, 19))
}

View file

@ -0,0 +1,18 @@
=== tests/cases/conformance/statements/for-ofStatements/ES5For-of27.ts ===
for (var {x: a = 0, y: b = 1} of [2, 3]) {
>x : any
>a : any
>0 : 0
>y : any
>b : any
>1 : 1
>[2, 3] : number[]
>2 : 2
>3 : 3
a;
>a : any
b;
>b : any
}

View file

@ -0,0 +1,11 @@
=== tests/cases/conformance/statements/for-ofStatements/ES5For-of28.ts ===
for (let [a = 0, b = 1] of [2, 3]) {
>a : Symbol(a, Decl(ES5For-of28.ts, 0, 10))
>b : Symbol(b, Decl(ES5For-of28.ts, 0, 16))
a;
>a : Symbol(a, Decl(ES5For-of28.ts, 0, 10))
b;
>b : Symbol(b, Decl(ES5For-of28.ts, 0, 16))
}

View file

@ -0,0 +1,16 @@
=== tests/cases/conformance/statements/for-ofStatements/ES5For-of28.ts ===
for (let [a = 0, b = 1] of [2, 3]) {
>a : any
>0 : 0
>b : any
>1 : 1
>[2, 3] : number[]
>2 : 2
>3 : 3
a;
>a : any
b;
>b : any
}

View file

@ -0,0 +1,11 @@
=== tests/cases/conformance/statements/for-ofStatements/ES5For-of29.ts ===
for (const {x: a = 0, y: b = 1} of [2, 3]) {
>a : Symbol(a, Decl(ES5For-of29.ts, 0, 12))
>b : Symbol(b, Decl(ES5For-of29.ts, 0, 21))
a;
>a : Symbol(a, Decl(ES5For-of29.ts, 0, 12))
b;
>b : Symbol(b, Decl(ES5For-of29.ts, 0, 21))
}

View file

@ -0,0 +1,18 @@
=== tests/cases/conformance/statements/for-ofStatements/ES5For-of29.ts ===
for (const {x: a = 0, y: b = 1} of [2, 3]) {
>x : any
>a : any
>0 : 0
>y : any
>b : any
>1 : 1
>[2, 3] : number[]
>2 : 2
>3 : 3
a;
>a : any
b;
>b : any
}

View file

@ -0,0 +1,19 @@
=== tests/cases/conformance/statements/for-ofStatements/ES5For-of30.ts ===
var a: string, b: number;
>a : Symbol(a, Decl(ES5For-of30.ts, 0, 3))
>b : Symbol(b, Decl(ES5For-of30.ts, 0, 14))
var tuple: [number, string] = [2, "3"];
>tuple : Symbol(tuple, Decl(ES5For-of30.ts, 1, 3))
for ([a = 1, b = ""] of tuple) {
>a : Symbol(a, Decl(ES5For-of30.ts, 0, 3))
>b : Symbol(b, Decl(ES5For-of30.ts, 0, 14))
>tuple : Symbol(tuple, Decl(ES5For-of30.ts, 1, 3))
a;
>a : Symbol(a, Decl(ES5For-of30.ts, 0, 3))
b;
>b : Symbol(b, Decl(ES5For-of30.ts, 0, 14))
}

View file

@ -0,0 +1,27 @@
=== tests/cases/conformance/statements/for-ofStatements/ES5For-of30.ts ===
var a: string, b: number;
>a : string
>b : number
var tuple: [number, string] = [2, "3"];
>tuple : [number, string]
>[2, "3"] : [number, string]
>2 : 2
>"3" : "3"
for ([a = 1, b = ""] of tuple) {
>[a = 1, b = ""] : [number, string]
>a = 1 : 1
>a : string
>1 : 1
>b = "" : ""
>b : number
>"" : ""
>tuple : [number, string]
a;
>a : string
b;
>b : number
}

View file

@ -0,0 +1,17 @@
=== tests/cases/conformance/statements/for-ofStatements/ES5For-of31.ts ===
var a: string, b: number;
>a : Symbol(a, Decl(ES5For-of31.ts, 0, 3))
>b : Symbol(b, Decl(ES5For-of31.ts, 0, 14))
for ({ a: b = 1, b: a = ""} of []) {
>a : Symbol(a, Decl(ES5For-of31.ts, 2, 6))
>b : Symbol(b, Decl(ES5For-of31.ts, 0, 14))
>b : Symbol(b, Decl(ES5For-of31.ts, 2, 16))
>a : Symbol(a, Decl(ES5For-of31.ts, 0, 3))
a;
>a : Symbol(a, Decl(ES5For-of31.ts, 0, 3))
b;
>b : Symbol(b, Decl(ES5For-of31.ts, 0, 14))
}

View file

@ -0,0 +1,23 @@
=== tests/cases/conformance/statements/for-ofStatements/ES5For-of31.ts ===
var a: string, b: number;
>a : string
>b : number
for ({ a: b = 1, b: a = ""} of []) {
>{ a: b = 1, b: a = ""} : { a?: number; b?: string; }
>a : undefined
>b = 1 : 1
>b : number
>1 : 1
>b : undefined
>a = "" : ""
>a : string
>"" : ""
>[] : undefined[]
a;
>a : string
b;
>b : number
}

View file

@ -0,0 +1,7 @@
=== tests/cases/conformance/statements/for-ofStatements/ES5For-of33.ts ===
for (var v of ['a', 'b', 'c']) {
>v : Symbol(v, Decl(ES5For-of33.ts, 0, 8))
console.log(v);
>v : Symbol(v, Decl(ES5For-of33.ts, 0, 8))
}

View file

@ -0,0 +1,15 @@
=== tests/cases/conformance/statements/for-ofStatements/ES5For-of33.ts ===
for (var v of ['a', 'b', 'c']) {
>v : string
>['a', 'b', 'c'] : string[]
>'a' : "a"
>'b' : "b"
>'c' : "c"
console.log(v);
>console.log(v) : any
>console.log : any
>console : any
>log : any
>v : string
}

View file

@ -0,0 +1,18 @@
=== tests/cases/conformance/statements/for-ofStatements/ES5For-of34.ts ===
function foo() {
>foo : Symbol(foo, Decl(ES5For-of34.ts, 0, 0))
return { x: 0 };
>x : Symbol(x, Decl(ES5For-of34.ts, 1, 12))
}
for (foo().x of ['a', 'b', 'c']) {
>foo().x : Symbol(x, Decl(ES5For-of34.ts, 1, 12))
>foo : Symbol(foo, Decl(ES5For-of34.ts, 0, 0))
>x : Symbol(x, Decl(ES5For-of34.ts, 1, 12))
var p = foo().x;
>p : Symbol(p, Decl(ES5For-of34.ts, 4, 7))
>foo().x : Symbol(x, Decl(ES5For-of34.ts, 1, 12))
>foo : Symbol(foo, Decl(ES5For-of34.ts, 0, 0))
>x : Symbol(x, Decl(ES5For-of34.ts, 1, 12))
}

View file

@ -0,0 +1,26 @@
=== tests/cases/conformance/statements/for-ofStatements/ES5For-of34.ts ===
function foo() {
>foo : () => { x: number; }
return { x: 0 };
>{ x: 0 } : { x: number; }
>x : number
>0 : 0
}
for (foo().x of ['a', 'b', 'c']) {
>foo().x : number
>foo() : { x: number; }
>foo : () => { x: number; }
>x : number
>['a', 'b', 'c'] : string[]
>'a' : "a"
>'b' : "b"
>'c' : "c"
var p = foo().x;
>p : number
>foo().x : number
>foo() : { x: number; }
>foo : () => { x: number; }
>x : number
}

View file

@ -0,0 +1,11 @@
=== tests/cases/conformance/statements/for-ofStatements/ES5For-of35.ts ===
for (const {x: a = 0, y: b = 1} of [2, 3]) {
>a : Symbol(a, Decl(ES5For-of35.ts, 0, 12))
>b : Symbol(b, Decl(ES5For-of35.ts, 0, 21))
a;
>a : Symbol(a, Decl(ES5For-of35.ts, 0, 12))
b;
>b : Symbol(b, Decl(ES5For-of35.ts, 0, 21))
}

View file

@ -0,0 +1,18 @@
=== tests/cases/conformance/statements/for-ofStatements/ES5For-of35.ts ===
for (const {x: a = 0, y: b = 1} of [2, 3]) {
>x : any
>a : any
>0 : 0
>y : any
>b : any
>1 : 1
>[2, 3] : number[]
>2 : 2
>3 : 3
a;
>a : any
b;
>b : any
}

View file

@ -0,0 +1,11 @@
=== tests/cases/conformance/statements/for-ofStatements/ES5For-of36.ts ===
for (let [a = 0, b = 1] of [2, 3]) {
>a : Symbol(a, Decl(ES5For-of36.ts, 0, 10))
>b : Symbol(b, Decl(ES5For-of36.ts, 0, 16))
a;
>a : Symbol(a, Decl(ES5For-of36.ts, 0, 10))
b;
>b : Symbol(b, Decl(ES5For-of36.ts, 0, 16))
}

View file

@ -0,0 +1,16 @@
=== tests/cases/conformance/statements/for-ofStatements/ES5For-of36.ts ===
for (let [a = 0, b = 1] of [2, 3]) {
>a : any
>0 : 0
>b : any
>1 : 1
>[2, 3] : number[]
>2 : 2
>3 : 3
a;
>a : any
b;
>b : any
}

View file

@ -0,0 +1,17 @@
=== tests/cases/conformance/statements/for-ofStatements/ES5For-of7.ts ===
for (var w of []) {
>w : Symbol(w, Decl(ES5For-of7.ts, 0, 8))
var x = w;
>x : Symbol(x, Decl(ES5For-of7.ts, 1, 7), Decl(ES5For-of7.ts, 5, 7))
>w : Symbol(w, Decl(ES5For-of7.ts, 0, 8))
}
for (var v of []) {
>v : Symbol(v, Decl(ES5For-of7.ts, 4, 8))
var x = [w, v];
>x : Symbol(x, Decl(ES5For-of7.ts, 1, 7), Decl(ES5For-of7.ts, 5, 7))
>w : Symbol(w, Decl(ES5For-of7.ts, 0, 8))
>v : Symbol(v, Decl(ES5For-of7.ts, 4, 8))
}

View file

@ -0,0 +1,20 @@
=== tests/cases/conformance/statements/for-ofStatements/ES5For-of7.ts ===
for (var w of []) {
>w : any
>[] : undefined[]
var x = w;
>x : any
>w : any
}
for (var v of []) {
>v : any
>[] : undefined[]
var x = [w, v];
>x : any
>[w, v] : any[]
>w : any
>v : any
}

View file

@ -0,0 +1,18 @@
=== tests/cases/conformance/statements/for-ofStatements/ES5For-of8.ts ===
function foo() {
>foo : Symbol(foo, Decl(ES5For-of8.ts, 0, 0))
return { x: 0 };
>x : Symbol(x, Decl(ES5For-of8.ts, 1, 12))
}
for (foo().x of ['a', 'b', 'c']) {
>foo().x : Symbol(x, Decl(ES5For-of8.ts, 1, 12))
>foo : Symbol(foo, Decl(ES5For-of8.ts, 0, 0))
>x : Symbol(x, Decl(ES5For-of8.ts, 1, 12))
var p = foo().x;
>p : Symbol(p, Decl(ES5For-of8.ts, 4, 7))
>foo().x : Symbol(x, Decl(ES5For-of8.ts, 1, 12))
>foo : Symbol(foo, Decl(ES5For-of8.ts, 0, 0))
>x : Symbol(x, Decl(ES5For-of8.ts, 1, 12))
}

View file

@ -0,0 +1,26 @@
=== tests/cases/conformance/statements/for-ofStatements/ES5For-of8.ts ===
function foo() {
>foo : () => { x: number; }
return { x: 0 };
>{ x: 0 } : { x: number; }
>x : number
>0 : 0
}
for (foo().x of ['a', 'b', 'c']) {
>foo().x : number
>foo() : { x: number; }
>foo : () => { x: number; }
>x : number
>['a', 'b', 'c'] : string[]
>'a' : "a"
>'b' : "b"
>'c' : "c"
var p = foo().x;
>p : number
>foo().x : number
>foo() : { x: number; }
>foo : () => { x: number; }
>x : number
}

View file

@ -0,0 +1,27 @@
=== tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck10.ts ===
// In ES3/5, you cannot for...of over an arbitrary iterable.
class StringIterator {
>StringIterator : Symbol(StringIterator, Decl(ES5For-ofTypeCheck10.ts, 0, 0))
next() {
>next : Symbol(StringIterator.next, Decl(ES5For-ofTypeCheck10.ts, 1, 22))
return {
done: true,
>done : Symbol(done, Decl(ES5For-ofTypeCheck10.ts, 3, 16))
value: ""
>value : Symbol(value, Decl(ES5For-ofTypeCheck10.ts, 4, 23))
};
}
[Symbol.iterator]() {
return this;
>this : Symbol(StringIterator, Decl(ES5For-ofTypeCheck10.ts, 0, 0))
}
}
for (var v of new StringIterator) { }
>v : Symbol(v, Decl(ES5For-ofTypeCheck10.ts, 13, 8))
>StringIterator : Symbol(StringIterator, Decl(ES5For-ofTypeCheck10.ts, 0, 0))

View file

@ -0,0 +1,36 @@
=== tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck10.ts ===
// In ES3/5, you cannot for...of over an arbitrary iterable.
class StringIterator {
>StringIterator : StringIterator
next() {
>next : () => { done: boolean; value: string; }
return {
>{ done: true, value: "" } : { done: boolean; value: string; }
done: true,
>done : boolean
>true : true
value: ""
>value : string
>"" : ""
};
}
[Symbol.iterator]() {
>Symbol.iterator : any
>Symbol : any
>iterator : any
return this;
>this : this
}
}
for (var v of new StringIterator) { }
>v : any
>new StringIterator : StringIterator
>StringIterator : typeof StringIterator

Some files were not shown because too many files have changed in this diff Show more