Ensure comments before // @Filename are not part of the following virtual test file (#57579)

This commit is contained in:
Andrew Branch
2024-02-28 13:40:10 -08:00
committed by GitHub
parent 63dd17baef
commit cfbb15f0c1
239 changed files with 875 additions and 1419 deletions
+4
View File
@@ -1232,6 +1232,10 @@ export namespace TestCaseParser {
else {
// First metadata marker in the file
currentFileName = testMetaData[2].trim();
if (currentFileContent && ts.skipTrivia(currentFileContent, 0, /*stopAfterLineBreak*/ false, /*stopAtComments*/ false) !== currentFileContent.length) {
throw new Error("Non-comment test content appears before the first '// @Filename' directive");
}
currentFileContent = "";
}
}
else {
@@ -1,7 +1,6 @@
//// [tests/cases/compiler/blockScopedNamespaceDifferentFile.ts] ////
//// [test.ts]
// #15734 failed when test.ts comes before typings.d.ts
namespace C {
export class Name {
static funcData = A.AA.func();
@@ -21,7 +20,6 @@ declare namespace A {
//// [out.js]
// #15734 failed when test.ts comes before typings.d.ts
var C;
(function (C) {
var Name = /** @class */ (function () {
@@ -1,15 +1,14 @@
//// [tests/cases/compiler/blockScopedNamespaceDifferentFile.ts] ////
=== test.ts ===
// #15734 failed when test.ts comes before typings.d.ts
namespace C {
>C : Symbol(C, Decl(test.ts, 0, 0))
export class Name {
>Name : Symbol(Name, Decl(test.ts, 1, 13))
>Name : Symbol(Name, Decl(test.ts, 0, 13))
static funcData = A.AA.func();
>funcData : Symbol(Name.funcData, Decl(test.ts, 2, 23))
>funcData : Symbol(Name.funcData, Decl(test.ts, 1, 23))
>A.AA.func : Symbol(A.AA.func, Decl(typings.d.ts, 1, 18))
>A.AA : Symbol(A.AA, Decl(typings.d.ts, 0, 21))
>A : Symbol(A, Decl(typings.d.ts, 0, 0))
@@ -17,7 +16,7 @@ namespace C {
>func : Symbol(A.AA.func, Decl(typings.d.ts, 1, 18))
static someConst = A.AA.foo;
>someConst : Symbol(Name.someConst, Decl(test.ts, 3, 38))
>someConst : Symbol(Name.someConst, Decl(test.ts, 2, 38))
>A.AA.foo : Symbol(A.AA.foo, Decl(typings.d.ts, 3, 13))
>A.AA : Symbol(A.AA, Decl(typings.d.ts, 0, 21))
>A : Symbol(A, Decl(typings.d.ts, 0, 0))
@@ -25,7 +24,7 @@ namespace C {
>foo : Symbol(A.AA.foo, Decl(typings.d.ts, 3, 13))
constructor(parameters) {}
>parameters : Symbol(parameters, Decl(test.ts, 6, 20))
>parameters : Symbol(parameters, Decl(test.ts, 5, 20))
}
}
@@ -1,7 +1,6 @@
//// [tests/cases/compiler/blockScopedNamespaceDifferentFile.ts] ////
=== test.ts ===
// #15734 failed when test.ts comes before typings.d.ts
namespace C {
>C : typeof C
@@ -12,19 +12,17 @@ hardline
>hardline : Symbol(hardline, Decl(main.js, 0, 7))
=== first.js ===
// #41422, based on prettier's exports
const hardline = { type: "hard" }
>hardline : Symbol(hardline, Decl(first.js, 2, 5))
>type : Symbol(type, Decl(first.js, 2, 18))
>hardline : Symbol(hardline, Decl(first.js, 0, 5))
>type : Symbol(type, Decl(first.js, 0, 18))
module.exports = {
>module.exports : Symbol(module.exports, Decl(first.js, 0, 0))
>module : Symbol(module, Decl(first.js, 2, 33))
>module : Symbol(module, Decl(first.js, 0, 33))
>exports : Symbol(module.exports, Decl(first.js, 0, 0))
hardline
>hardline : Symbol(hardline, Decl(first.js, 3, 18))
>hardline : Symbol(hardline, Decl(first.js, 1, 18))
}
@@ -13,8 +13,6 @@ hardline
>hardline : { type: string; }
=== first.js ===
// #41422, based on prettier's exports
const hardline = { type: "hard" }
>hardline : { type: string; }
>{ type: "hard" } : { type: string; }
@@ -14,9 +14,6 @@ if (a) {
>a : Symbol(a, Decl(bar.js, 0, 7))
}
=== /foo.d.ts ===
// Regresion test for GH#41957
export const a: number | null;
>a : Symbol(a, Decl(foo.d.ts, 3, 12))
>a : Symbol(a, Decl(foo.d.ts, 0, 12))
@@ -17,9 +17,6 @@ if (a) {
>1 : 1
}
=== /foo.d.ts ===
// Regresion test for GH#41957
export const a: number | null;
>a : number | null
@@ -1,8 +1,6 @@
//// [tests/cases/compiler/commonSourceDirectory.ts] ////
//// [index.ts]
// Test that importing a file from `node_modules` does not affect calculation of the common source directory.
export const x = 0;
//// [bar.d.ts]
@@ -1,3 +1,3 @@
//// [/app/bin/index.js.map]
{"version":3,"file":"index.js","sourceRoot":"mySourceRoot/","sources":["index.ts"],"names":[],"mappings":";;AAAA,yCAAyC;AACzC,2BAAwB;AACxB,2BAAwB;AACxB,OAAC,GAAG,OAAC,CAAC"}
//// https://sokra.github.io/source-map-visualization#base64,InVzZSBzdHJpY3QiOw0KT2JqZWN0LmRlZmluZVByb3BlcnR5KGV4cG9ydHMsICJfX2VzTW9kdWxlIiwgeyB2YWx1ZTogdHJ1ZSB9KTsNCi8vLyA8cmVmZXJlbmNlIHBhdGg9Ii4uL3R5cGVzL2Jhci5kLnRzIi8+DQp2YXIgZm9vXzEgPSByZXF1aXJlKCJmb28iKTsNCnZhciBiYXJfMSA9IHJlcXVpcmUoImJhciIpOw0KZm9vXzEueCArIGJhcl8xLnk7DQovLyMgc291cmNlTWFwcGluZ1VSTD0uLi9teU1hcFJvb3QvaW5kZXguanMubWFw,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoibXlTb3VyY2VSb290LyIsInNvdXJjZXMiOlsiaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQSx5Q0FBeUM7QUFDekMsMkJBQXdCO0FBQ3hCLDJCQUF3QjtBQUN4QixPQUFDLEdBQUcsT0FBQyxDQUFDIn0=,Ly8gVGVzdCB0aGF0IGltcG9ydGluZyBhIGZpbGUgZnJvbSBgbm9kZV9tb2R1bGVzYCBkb2VzIG5vdCBhZmZlY3QgY2FsY3VsYXRpb24gb2YgdGhlIGNvbW1vbiBzb3VyY2UgZGlyZWN0b3J5LgoKZXhwb3J0IGNvbnN0IHggPSAwOwo=
//// https://sokra.github.io/source-map-visualization#base64,InVzZSBzdHJpY3QiOw0KT2JqZWN0LmRlZmluZVByb3BlcnR5KGV4cG9ydHMsICJfX2VzTW9kdWxlIiwgeyB2YWx1ZTogdHJ1ZSB9KTsNCi8vLyA8cmVmZXJlbmNlIHBhdGg9Ii4uL3R5cGVzL2Jhci5kLnRzIi8+DQp2YXIgZm9vXzEgPSByZXF1aXJlKCJmb28iKTsNCnZhciBiYXJfMSA9IHJlcXVpcmUoImJhciIpOw0KZm9vXzEueCArIGJhcl8xLnk7DQovLyMgc291cmNlTWFwcGluZ1VSTD0uLi9teU1hcFJvb3QvaW5kZXguanMubWFw,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoibXlTb3VyY2VSb290LyIsInNvdXJjZXMiOlsiaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQSx5Q0FBeUM7QUFDekMsMkJBQXdCO0FBQ3hCLDJCQUF3QjtBQUN4QixPQUFDLEdBQUcsT0FBQyxDQUFDIn0=,ZXhwb3J0IGNvbnN0IHggPSAwOwo=
@@ -13,10 +13,8 @@ x + y;
>y : Symbol(y, Decl(index.ts, 2, 8))
=== /node_modules/foo/index.ts ===
// Test that importing a file from `node_modules` does not affect calculation of the common source directory.
export const x = 0;
>x : Symbol(x, Decl(index.ts, 2, 12))
>x : Symbol(x, Decl(index.ts, 0, 12))
=== /types/bar.d.ts ===
declare module "bar" {
@@ -14,8 +14,6 @@ x + y;
>y : 0
=== /node_modules/foo/index.ts ===
// Test that importing a file from `node_modules` does not affect calculation of the common source directory.
export const x = 0;
>x : 0
>0 : 0
@@ -1,8 +1,6 @@
//// [tests/cases/compiler/commonSourceDirectory_dts.ts] ////
//// [bar.d.ts]
// Test that importing a file from `node_modules` does not affect calculation of the common source directory.
declare const y: number;
//// [index.ts]
@@ -1,14 +1,12 @@
//// [tests/cases/compiler/commonSourceDirectory_dts.ts] ////
=== /app/lib/bar.d.ts ===
// Test that importing a file from `node_modules` does not affect calculation of the common source directory.
declare const y: number;
>y : Symbol(y, Decl(bar.d.ts, 2, 13))
>y : Symbol(y, Decl(bar.d.ts, 0, 13))
=== /app/src/index.ts ===
/// <reference path="../lib/bar.d.ts" />
export const x = y;
>x : Symbol(x, Decl(index.ts, 1, 12))
>y : Symbol(y, Decl(bar.d.ts, 2, 13))
>y : Symbol(y, Decl(bar.d.ts, 0, 13))
@@ -1,8 +1,6 @@
//// [tests/cases/compiler/commonSourceDirectory_dts.ts] ////
=== /app/lib/bar.d.ts ===
// Test that importing a file from `node_modules` does not affect calculation of the common source directory.
declare const y: number;
>y : number
@@ -3,8 +3,6 @@ error TS5095: Option 'bundler' can only be used when 'module' is set to 'preserv
!!! error TS5095: Option 'bundler' can only be used when 'module' is set to 'preserve' or to 'es2015' or later.
==== /node_modules/dep/package.json (0 errors) ====
// This documents bug https://github.com/microsoft/TypeScript/issues/50762.
{
"name": "dep",
"version": "1.0.0",
@@ -3,8 +3,6 @@ error TS5110: Option 'module' must be set to 'Node16' when option 'moduleResolut
!!! error TS5110: Option 'module' must be set to 'Node16' when option 'moduleResolution' is set to 'Node16'.
==== /node_modules/dep/package.json (0 errors) ====
// This documents bug https://github.com/microsoft/TypeScript/issues/50762.
{
"name": "dep",
"version": "1.0.0",
@@ -3,8 +3,6 @@ error TS5110: Option 'module' must be set to 'NodeNext' when option 'moduleResol
!!! error TS5110: Option 'module' must be set to 'NodeNext' when option 'moduleResolution' is set to 'NodeNext'.
==== /node_modules/dep/package.json (0 errors) ====
// This documents bug https://github.com/microsoft/TypeScript/issues/50762.
{
"name": "dep",
"version": "1.0.0",
@@ -1,7 +1,6 @@
//// [tests/cases/compiler/decoratorReferenceOnOtherProperty.ts] ////
//// [yoha.ts]
// https://github.com/Microsoft/TypeScript/issues/19799
export class Yoha {}
//// [index.ts]
@@ -28,7 +27,6 @@ class Bar {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Yoha = void 0;
// https://github.com/Microsoft/TypeScript/issues/19799
var Yoha = /** @class */ (function () {
function Yoha() {
}
@@ -1,7 +1,6 @@
//// [tests/cases/compiler/decoratorReferenceOnOtherProperty.ts] ////
=== yoha.ts ===
// https://github.com/Microsoft/TypeScript/issues/19799
export class Yoha {}
>Yoha : Symbol(Yoha, Decl(yoha.ts, 0, 0))
@@ -1,7 +1,6 @@
//// [tests/cases/compiler/decoratorReferenceOnOtherProperty.ts] ////
=== yoha.ts ===
// https://github.com/Microsoft/TypeScript/issues/19799
export class Yoha {}
>Yoha : Yoha
@@ -1,6 +1,6 @@
//// [tests/cases/compiler/doNotEmitPinnedCommentOnNotEmittedNode.ts] ////
//// [file1.ts]
//// [doNotEmitPinnedCommentOnNotEmittedNode.ts]
class C {
/*! remove pinned comment anywhere else */
public foo(x: string, y: any)
@@ -12,7 +12,7 @@ var x = 10;
/*! remove pinned comment anywhere else */
declare var OData: any;
//// [file1.js]
//// [doNotEmitPinnedCommentOnNotEmittedNode.js]
var C = (function () {
function C() {
}
@@ -1,25 +1,25 @@
//// [tests/cases/compiler/doNotEmitPinnedCommentOnNotEmittedNode.ts] ////
=== file1.ts ===
=== doNotEmitPinnedCommentOnNotEmittedNode.ts ===
class C {
>C : Symbol(C, Decl(file1.ts, 0, 0))
>C : Symbol(C, Decl(doNotEmitPinnedCommentOnNotEmittedNode.ts, 0, 0))
/*! remove pinned comment anywhere else */
public foo(x: string, y: any)
>foo : Symbol(C.foo, Decl(file1.ts, 0, 9), Decl(file1.ts, 2, 33))
>x : Symbol(x, Decl(file1.ts, 2, 15))
>y : Symbol(y, Decl(file1.ts, 2, 25))
>foo : Symbol(C.foo, Decl(doNotEmitPinnedCommentOnNotEmittedNode.ts, 0, 9), Decl(doNotEmitPinnedCommentOnNotEmittedNode.ts, 2, 33))
>x : Symbol(x, Decl(doNotEmitPinnedCommentOnNotEmittedNode.ts, 2, 15))
>y : Symbol(y, Decl(doNotEmitPinnedCommentOnNotEmittedNode.ts, 2, 25))
public foo(x: string, y: number) { }
>foo : Symbol(C.foo, Decl(file1.ts, 0, 9), Decl(file1.ts, 2, 33))
>x : Symbol(x, Decl(file1.ts, 3, 15))
>y : Symbol(y, Decl(file1.ts, 3, 25))
>foo : Symbol(C.foo, Decl(doNotEmitPinnedCommentOnNotEmittedNode.ts, 0, 9), Decl(doNotEmitPinnedCommentOnNotEmittedNode.ts, 2, 33))
>x : Symbol(x, Decl(doNotEmitPinnedCommentOnNotEmittedNode.ts, 3, 15))
>y : Symbol(y, Decl(doNotEmitPinnedCommentOnNotEmittedNode.ts, 3, 25))
}
var x = 10;
>x : Symbol(x, Decl(file1.ts, 6, 3))
>x : Symbol(x, Decl(doNotEmitPinnedCommentOnNotEmittedNode.ts, 6, 3))
/*! remove pinned comment anywhere else */
declare var OData: any;
>OData : Symbol(OData, Decl(file1.ts, 9, 11))
>OData : Symbol(OData, Decl(doNotEmitPinnedCommentOnNotEmittedNode.ts, 9, 11))
@@ -1,6 +1,6 @@
//// [tests/cases/compiler/doNotEmitPinnedCommentOnNotEmittedNode.ts] ////
=== file1.ts ===
=== doNotEmitPinnedCommentOnNotEmittedNode.ts ===
class C {
>C : C
@@ -1,17 +1,16 @@
duplicateIdentifierEnum_A.ts(2,6): error TS2567: Enum declarations can only merge with namespace or other enum declarations.
duplicateIdentifierEnum_A.ts(5,7): error TS2567: Enum declarations can only merge with namespace or other enum declarations.
duplicateIdentifierEnum_A.ts(9,11): error TS2567: Enum declarations can only merge with namespace or other enum declarations.
duplicateIdentifierEnum_A.ts(12,12): error TS2567: Enum declarations can only merge with namespace or other enum declarations.
duplicateIdentifierEnum_A.ts(16,12): error TS2567: Enum declarations can only merge with namespace or other enum declarations.
duplicateIdentifierEnum_A.ts(19,10): error TS2567: Enum declarations can only merge with namespace or other enum declarations.
duplicateIdentifierEnum_A.ts(23,6): error TS2567: Enum declarations can only merge with namespace or other enum declarations.
duplicateIdentifierEnum_A.ts(26,7): error TS2567: Enum declarations can only merge with namespace or other enum declarations.
duplicateIdentifierEnum_A.ts(1,6): error TS2567: Enum declarations can only merge with namespace or other enum declarations.
duplicateIdentifierEnum_A.ts(4,7): error TS2567: Enum declarations can only merge with namespace or other enum declarations.
duplicateIdentifierEnum_A.ts(8,11): error TS2567: Enum declarations can only merge with namespace or other enum declarations.
duplicateIdentifierEnum_A.ts(11,12): error TS2567: Enum declarations can only merge with namespace or other enum declarations.
duplicateIdentifierEnum_A.ts(15,12): error TS2567: Enum declarations can only merge with namespace or other enum declarations.
duplicateIdentifierEnum_A.ts(18,10): error TS2567: Enum declarations can only merge with namespace or other enum declarations.
duplicateIdentifierEnum_A.ts(22,6): error TS2567: Enum declarations can only merge with namespace or other enum declarations.
duplicateIdentifierEnum_A.ts(25,7): error TS2567: Enum declarations can only merge with namespace or other enum declarations.
duplicateIdentifierEnum_B.ts(1,10): error TS2567: Enum declarations can only merge with namespace or other enum declarations.
duplicateIdentifierEnum_B.ts(4,6): error TS2567: Enum declarations can only merge with namespace or other enum declarations.
==== duplicateIdentifierEnum_A.ts (8 errors) ====
// Test the error message when attempting to merge an enum with a class, an interface, or a function.
enum A {
~
!!! error TS2567: Enum declarations can only merge with namespace or other enum declarations.
@@ -62,12 +61,12 @@ duplicateIdentifierEnum_B.ts(4,6): error TS2567: Enum declarations can only merg
function D() {
~
!!! error TS2567: Enum declarations can only merge with namespace or other enum declarations.
!!! related TS6203 duplicateIdentifierEnum_A.ts:23:6: 'D' was also declared here.
!!! related TS6203 duplicateIdentifierEnum_A.ts:22:6: 'D' was also declared here.
return 0;
}
enum E {
~
!!! error TS2567: Enum declarations can only merge with namespace or other enum declarations.
!!! related TS6203 duplicateIdentifierEnum_A.ts:26:7: 'E' was also declared here.
!!! related TS6203 duplicateIdentifierEnum_A.ts:25:7: 'E' was also declared here.
bar
}
@@ -1,7 +1,6 @@
//// [tests/cases/compiler/duplicateIdentifierEnum.ts] ////
//// [duplicateIdentifierEnum_A.ts]
// Test the error message when attempting to merge an enum with a class, an interface, or a function.
enum A {
bar
}
@@ -39,7 +38,6 @@ enum E {
}
//// [duplicateIdentifierEnum_A.js]
// Test the error message when attempting to merge an enum with a class, an interface, or a function.
var A;
(function (A) {
A[A["bar"] = 0] = "bar";
@@ -1,54 +1,53 @@
//// [tests/cases/compiler/duplicateIdentifierEnum.ts] ////
=== duplicateIdentifierEnum_A.ts ===
// Test the error message when attempting to merge an enum with a class, an interface, or a function.
enum A {
>A : Symbol(A, Decl(duplicateIdentifierEnum_A.ts, 0, 0))
bar
>bar : Symbol(A.bar, Decl(duplicateIdentifierEnum_A.ts, 1, 8))
>bar : Symbol(A.bar, Decl(duplicateIdentifierEnum_A.ts, 0, 8))
}
class A {
>A : Symbol(A, Decl(duplicateIdentifierEnum_A.ts, 3, 1))
>A : Symbol(A, Decl(duplicateIdentifierEnum_A.ts, 2, 1))
foo: number;
>foo : Symbol(A.foo, Decl(duplicateIdentifierEnum_A.ts, 4, 9))
>foo : Symbol(A.foo, Decl(duplicateIdentifierEnum_A.ts, 3, 9))
}
interface B {
>B : Symbol(B, Decl(duplicateIdentifierEnum_A.ts, 6, 1))
>B : Symbol(B, Decl(duplicateIdentifierEnum_A.ts, 5, 1))
foo: number;
>foo : Symbol(B.foo, Decl(duplicateIdentifierEnum_A.ts, 8, 13))
>foo : Symbol(B.foo, Decl(duplicateIdentifierEnum_A.ts, 7, 13))
}
const enum B {
>B : Symbol(B, Decl(duplicateIdentifierEnum_A.ts, 10, 1))
>B : Symbol(B, Decl(duplicateIdentifierEnum_A.ts, 9, 1))
bar
>bar : Symbol(B.bar, Decl(duplicateIdentifierEnum_A.ts, 11, 14))
>bar : Symbol(B.bar, Decl(duplicateIdentifierEnum_A.ts, 10, 14))
}
const enum C {
>C : Symbol(C, Decl(duplicateIdentifierEnum_A.ts, 13, 1))
>C : Symbol(C, Decl(duplicateIdentifierEnum_A.ts, 12, 1))
}
function C() {
>C : Symbol(C, Decl(duplicateIdentifierEnum_A.ts, 17, 1))
>C : Symbol(C, Decl(duplicateIdentifierEnum_A.ts, 16, 1))
return 0;
}
enum D {
>D : Symbol(D, Decl(duplicateIdentifierEnum_A.ts, 20, 1))
>D : Symbol(D, Decl(duplicateIdentifierEnum_A.ts, 19, 1))
bar
>bar : Symbol(D.bar, Decl(duplicateIdentifierEnum_A.ts, 22, 8))
>bar : Symbol(D.bar, Decl(duplicateIdentifierEnum_A.ts, 21, 8))
}
class E {
>E : Symbol(E, Decl(duplicateIdentifierEnum_A.ts, 24, 1))
>E : Symbol(E, Decl(duplicateIdentifierEnum_A.ts, 23, 1))
foo: number;
>foo : Symbol(E.foo, Decl(duplicateIdentifierEnum_A.ts, 25, 9))
>foo : Symbol(E.foo, Decl(duplicateIdentifierEnum_A.ts, 24, 9))
}
// also make sure the error appears when trying to merge an enum in a separate file.
=== duplicateIdentifierEnum_B.ts ===
@@ -1,7 +1,6 @@
//// [tests/cases/compiler/duplicateIdentifierEnum.ts] ////
=== duplicateIdentifierEnum_A.ts ===
// Test the error message when attempting to merge an enum with a class, an interface, or a function.
enum A {
>A : A
@@ -1,21 +1,20 @@
f.ts(37,5): error TS2322: Type 'strings.DiagnosticCategory' is not assignable to type 'numerics.DiagnosticCategory'.
a.ts(36,5): error TS2322: Type 'strings.DiagnosticCategory' is not assignable to type 'numerics.DiagnosticCategory'.
Each declaration of 'DiagnosticCategory.Warning' differs in its value, where '0' was expected but '"Warning"' was given.
f.ts(38,5): error TS2322: Type 'numerics.DiagnosticCategory' is not assignable to type 'strings.DiagnosticCategory'.
a.ts(37,5): error TS2322: Type 'numerics.DiagnosticCategory' is not assignable to type 'strings.DiagnosticCategory'.
Each declaration of 'DiagnosticCategory.Warning' differs in its value, where '"Warning"' was expected but '0' was given.
f.ts(42,5): error TS2322: Type 'DiagnosticCategory' is not assignable to type 'DiagnosticCategory2'.
f.ts(43,5): error TS2322: Type 'DiagnosticCategory2' is not assignable to type 'DiagnosticCategory'.
f.ts(52,5): error TS2322: Type 'ambients.DiagnosticCategory' is not assignable to type 'strings.DiagnosticCategory'.
a.ts(41,5): error TS2322: Type 'DiagnosticCategory' is not assignable to type 'DiagnosticCategory2'.
a.ts(42,5): error TS2322: Type 'DiagnosticCategory2' is not assignable to type 'DiagnosticCategory'.
a.ts(51,5): error TS2322: Type 'ambients.DiagnosticCategory' is not assignable to type 'strings.DiagnosticCategory'.
One value of 'DiagnosticCategory.Warning' is the string '"Warning"', and the other is assumed to be an unknown numeric value.
f.ts(53,5): error TS2322: Type 'strings.DiagnosticCategory' is not assignable to type 'ambients.DiagnosticCategory'.
a.ts(52,5): error TS2322: Type 'strings.DiagnosticCategory' is not assignable to type 'ambients.DiagnosticCategory'.
One value of 'DiagnosticCategory.Warning' is the string '"Warning"', and the other is assumed to be an unknown numeric value.
f.ts(73,9): error TS2322: Type 'DiagnosticCategory' is not assignable to type 'import("f").DiagnosticCategory'.
f.ts(18,9): error TS2322: Type 'DiagnosticCategory' is not assignable to type 'import("f").DiagnosticCategory'.
Each declaration of 'DiagnosticCategory.Warning' differs in its value, where '0' was expected but '"Warning"' was given.
f.ts(74,9): error TS2322: Type 'import("f").DiagnosticCategory' is not assignable to type 'DiagnosticCategory'.
f.ts(19,9): error TS2322: Type 'import("f").DiagnosticCategory' is not assignable to type 'DiagnosticCategory'.
Each declaration of 'DiagnosticCategory.Warning' differs in its value, where '"Warning"' was expected but '0' was given.
==== f.ts (8 errors) ====
// @filename a.ts
==== a.ts (6 errors) ====
namespace numerics {
export enum DiagnosticCategory {
Warning,
@@ -86,6 +85,7 @@ f.ts(74,9): error TS2322: Type 'import("f").DiagnosticCategory' is not assignabl
!!! error TS2322: One value of 'DiagnosticCategory.Warning' is the string '"Warning"', and the other is assumed to be an unknown numeric value.
}
==== f.ts (2 errors) ====
export enum DiagnosticCategory {
Warning,
Error,
@@ -1,7 +1,6 @@
//// [tests/cases/compiler/enumAssignmentCompat6.ts] ////
//// [f.ts]
// @filename a.ts
//// [a.ts]
namespace numerics {
export enum DiagnosticCategory {
Warning,
@@ -55,7 +54,8 @@ function i(x: strings.DiagnosticCategory, y: ambients.DiagnosticCategory) {
x = y;
y = x;
}
//// [f.ts]
export enum DiagnosticCategory {
Warning,
Error,
@@ -78,11 +78,7 @@ export let x: DiagnosticCategory;
}
})()
//// [f.js]
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.x = exports.DiagnosticCategory = void 0;
// @filename a.ts
//// [a.js]
var numerics;
(function (numerics) {
var DiagnosticCategory;
@@ -126,6 +122,10 @@ function i(x, y) {
x = y;
y = x;
}
//// [f.js]
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.x = exports.DiagnosticCategory = void 0;
var DiagnosticCategory;
(function (DiagnosticCategory) {
DiagnosticCategory[DiagnosticCategory["Warning"] = 0] = "Warning";
@@ -1,202 +1,202 @@
//// [tests/cases/compiler/enumAssignmentCompat6.ts] ////
=== f.ts ===
// @filename a.ts
=== a.ts ===
namespace numerics {
>numerics : Symbol(numerics, Decl(f.ts, 0, 0))
>numerics : Symbol(numerics, Decl(a.ts, 0, 0))
export enum DiagnosticCategory {
>DiagnosticCategory : Symbol(DiagnosticCategory, Decl(f.ts, 1, 20))
>DiagnosticCategory : Symbol(DiagnosticCategory, Decl(a.ts, 0, 20))
Warning,
>Warning : Symbol(DiagnosticCategory.Warning, Decl(f.ts, 2, 36))
>Warning : Symbol(DiagnosticCategory.Warning, Decl(a.ts, 1, 36))
Error,
>Error : Symbol(DiagnosticCategory.Error, Decl(f.ts, 3, 16))
>Error : Symbol(DiagnosticCategory.Error, Decl(a.ts, 2, 16))
Suggestion,
>Suggestion : Symbol(DiagnosticCategory.Suggestion, Decl(f.ts, 4, 14))
>Suggestion : Symbol(DiagnosticCategory.Suggestion, Decl(a.ts, 3, 14))
Message,
>Message : Symbol(DiagnosticCategory.Message, Decl(f.ts, 5, 19))
>Message : Symbol(DiagnosticCategory.Message, Decl(a.ts, 4, 19))
}
export enum DiagnosticCategory2 {
>DiagnosticCategory2 : Symbol(DiagnosticCategory2, Decl(f.ts, 7, 5))
>DiagnosticCategory2 : Symbol(DiagnosticCategory2, Decl(a.ts, 6, 5))
Warning,
>Warning : Symbol(DiagnosticCategory2.Warning, Decl(f.ts, 9, 37))
>Warning : Symbol(DiagnosticCategory2.Warning, Decl(a.ts, 8, 37))
Error,
>Error : Symbol(DiagnosticCategory2.Error, Decl(f.ts, 10, 16))
>Error : Symbol(DiagnosticCategory2.Error, Decl(a.ts, 9, 16))
Suggestion,
>Suggestion : Symbol(DiagnosticCategory2.Suggestion, Decl(f.ts, 11, 14))
>Suggestion : Symbol(DiagnosticCategory2.Suggestion, Decl(a.ts, 10, 14))
Message,
>Message : Symbol(DiagnosticCategory2.Message, Decl(f.ts, 12, 19))
>Message : Symbol(DiagnosticCategory2.Message, Decl(a.ts, 11, 19))
}
}
namespace strings {
>strings : Symbol(strings, Decl(f.ts, 15, 1))
>strings : Symbol(strings, Decl(a.ts, 14, 1))
export enum DiagnosticCategory {
>DiagnosticCategory : Symbol(DiagnosticCategory, Decl(f.ts, 17, 19))
>DiagnosticCategory : Symbol(DiagnosticCategory, Decl(a.ts, 16, 19))
Warning = "Warning",
>Warning : Symbol(DiagnosticCategory.Warning, Decl(f.ts, 18, 36))
>Warning : Symbol(DiagnosticCategory.Warning, Decl(a.ts, 17, 36))
Error = "Error",
>Error : Symbol(DiagnosticCategory.Error, Decl(f.ts, 19, 28))
>Error : Symbol(DiagnosticCategory.Error, Decl(a.ts, 18, 28))
Suggestion = "Suggestion",
>Suggestion : Symbol(DiagnosticCategory.Suggestion, Decl(f.ts, 20, 24))
>Suggestion : Symbol(DiagnosticCategory.Suggestion, Decl(a.ts, 19, 24))
Message = "Message",
>Message : Symbol(DiagnosticCategory.Message, Decl(f.ts, 21, 34))
>Message : Symbol(DiagnosticCategory.Message, Decl(a.ts, 20, 34))
}
}
declare namespace ambients {
>ambients : Symbol(ambients, Decl(f.ts, 24, 1))
>ambients : Symbol(ambients, Decl(a.ts, 23, 1))
export enum DiagnosticCategory {
>DiagnosticCategory : Symbol(DiagnosticCategory, Decl(f.ts, 26, 28))
>DiagnosticCategory : Symbol(DiagnosticCategory, Decl(a.ts, 25, 28))
Warning,
>Warning : Symbol(DiagnosticCategory.Warning, Decl(f.ts, 27, 36))
>Warning : Symbol(DiagnosticCategory.Warning, Decl(a.ts, 26, 36))
Error,
>Error : Symbol(DiagnosticCategory.Error, Decl(f.ts, 28, 16))
>Error : Symbol(DiagnosticCategory.Error, Decl(a.ts, 27, 16))
Suggestion,
>Suggestion : Symbol(DiagnosticCategory.Suggestion, Decl(f.ts, 29, 14))
>Suggestion : Symbol(DiagnosticCategory.Suggestion, Decl(a.ts, 28, 14))
Message,
>Message : Symbol(DiagnosticCategory.Message, Decl(f.ts, 30, 19))
>Message : Symbol(DiagnosticCategory.Message, Decl(a.ts, 29, 19))
}
}
function f(x: numerics.DiagnosticCategory, y: strings.DiagnosticCategory) {
>f : Symbol(f, Decl(f.ts, 33, 1))
>x : Symbol(x, Decl(f.ts, 35, 11))
>numerics : Symbol(numerics, Decl(f.ts, 0, 0))
>DiagnosticCategory : Symbol(numerics.DiagnosticCategory, Decl(f.ts, 1, 20))
>y : Symbol(y, Decl(f.ts, 35, 42))
>strings : Symbol(strings, Decl(f.ts, 15, 1))
>DiagnosticCategory : Symbol(strings.DiagnosticCategory, Decl(f.ts, 17, 19))
>f : Symbol(f, Decl(a.ts, 32, 1))
>x : Symbol(x, Decl(a.ts, 34, 11))
>numerics : Symbol(numerics, Decl(a.ts, 0, 0))
>DiagnosticCategory : Symbol(numerics.DiagnosticCategory, Decl(a.ts, 0, 20))
>y : Symbol(y, Decl(a.ts, 34, 42))
>strings : Symbol(strings, Decl(a.ts, 14, 1))
>DiagnosticCategory : Symbol(strings.DiagnosticCategory, Decl(a.ts, 16, 19))
x = y;
>x : Symbol(x, Decl(f.ts, 35, 11))
>y : Symbol(y, Decl(f.ts, 35, 42))
>x : Symbol(x, Decl(a.ts, 34, 11))
>y : Symbol(y, Decl(a.ts, 34, 42))
y = x;
>y : Symbol(y, Decl(f.ts, 35, 42))
>x : Symbol(x, Decl(f.ts, 35, 11))
>y : Symbol(y, Decl(a.ts, 34, 42))
>x : Symbol(x, Decl(a.ts, 34, 11))
}
function g(x: numerics.DiagnosticCategory2, y: strings.DiagnosticCategory) {
>g : Symbol(g, Decl(f.ts, 38, 1))
>x : Symbol(x, Decl(f.ts, 40, 11))
>numerics : Symbol(numerics, Decl(f.ts, 0, 0))
>DiagnosticCategory2 : Symbol(numerics.DiagnosticCategory2, Decl(f.ts, 7, 5))
>y : Symbol(y, Decl(f.ts, 40, 43))
>strings : Symbol(strings, Decl(f.ts, 15, 1))
>DiagnosticCategory : Symbol(strings.DiagnosticCategory, Decl(f.ts, 17, 19))
>g : Symbol(g, Decl(a.ts, 37, 1))
>x : Symbol(x, Decl(a.ts, 39, 11))
>numerics : Symbol(numerics, Decl(a.ts, 0, 0))
>DiagnosticCategory2 : Symbol(numerics.DiagnosticCategory2, Decl(a.ts, 6, 5))
>y : Symbol(y, Decl(a.ts, 39, 43))
>strings : Symbol(strings, Decl(a.ts, 14, 1))
>DiagnosticCategory : Symbol(strings.DiagnosticCategory, Decl(a.ts, 16, 19))
x = y;
>x : Symbol(x, Decl(f.ts, 40, 11))
>y : Symbol(y, Decl(f.ts, 40, 43))
>x : Symbol(x, Decl(a.ts, 39, 11))
>y : Symbol(y, Decl(a.ts, 39, 43))
y = x;
>y : Symbol(y, Decl(f.ts, 40, 43))
>x : Symbol(x, Decl(f.ts, 40, 11))
>y : Symbol(y, Decl(a.ts, 39, 43))
>x : Symbol(x, Decl(a.ts, 39, 11))
}
function h(x: numerics.DiagnosticCategory, y: ambients.DiagnosticCategory) {
>h : Symbol(h, Decl(f.ts, 43, 1))
>x : Symbol(x, Decl(f.ts, 45, 11))
>numerics : Symbol(numerics, Decl(f.ts, 0, 0))
>DiagnosticCategory : Symbol(numerics.DiagnosticCategory, Decl(f.ts, 1, 20))
>y : Symbol(y, Decl(f.ts, 45, 42))
>ambients : Symbol(ambients, Decl(f.ts, 24, 1))
>DiagnosticCategory : Symbol(ambients.DiagnosticCategory, Decl(f.ts, 26, 28))
>h : Symbol(h, Decl(a.ts, 42, 1))
>x : Symbol(x, Decl(a.ts, 44, 11))
>numerics : Symbol(numerics, Decl(a.ts, 0, 0))
>DiagnosticCategory : Symbol(numerics.DiagnosticCategory, Decl(a.ts, 0, 20))
>y : Symbol(y, Decl(a.ts, 44, 42))
>ambients : Symbol(ambients, Decl(a.ts, 23, 1))
>DiagnosticCategory : Symbol(ambients.DiagnosticCategory, Decl(a.ts, 25, 28))
x = y;
>x : Symbol(x, Decl(f.ts, 45, 11))
>y : Symbol(y, Decl(f.ts, 45, 42))
>x : Symbol(x, Decl(a.ts, 44, 11))
>y : Symbol(y, Decl(a.ts, 44, 42))
y = x;
>y : Symbol(y, Decl(f.ts, 45, 42))
>x : Symbol(x, Decl(f.ts, 45, 11))
>y : Symbol(y, Decl(a.ts, 44, 42))
>x : Symbol(x, Decl(a.ts, 44, 11))
}
function i(x: strings.DiagnosticCategory, y: ambients.DiagnosticCategory) {
>i : Symbol(i, Decl(f.ts, 48, 1))
>x : Symbol(x, Decl(f.ts, 50, 11))
>strings : Symbol(strings, Decl(f.ts, 15, 1))
>DiagnosticCategory : Symbol(strings.DiagnosticCategory, Decl(f.ts, 17, 19))
>y : Symbol(y, Decl(f.ts, 50, 41))
>ambients : Symbol(ambients, Decl(f.ts, 24, 1))
>DiagnosticCategory : Symbol(ambients.DiagnosticCategory, Decl(f.ts, 26, 28))
>i : Symbol(i, Decl(a.ts, 47, 1))
>x : Symbol(x, Decl(a.ts, 49, 11))
>strings : Symbol(strings, Decl(a.ts, 14, 1))
>DiagnosticCategory : Symbol(strings.DiagnosticCategory, Decl(a.ts, 16, 19))
>y : Symbol(y, Decl(a.ts, 49, 41))
>ambients : Symbol(ambients, Decl(a.ts, 23, 1))
>DiagnosticCategory : Symbol(ambients.DiagnosticCategory, Decl(a.ts, 25, 28))
x = y;
>x : Symbol(x, Decl(f.ts, 50, 11))
>y : Symbol(y, Decl(f.ts, 50, 41))
>x : Symbol(x, Decl(a.ts, 49, 11))
>y : Symbol(y, Decl(a.ts, 49, 41))
y = x;
>y : Symbol(y, Decl(f.ts, 50, 41))
>x : Symbol(x, Decl(f.ts, 50, 11))
>y : Symbol(y, Decl(a.ts, 49, 41))
>x : Symbol(x, Decl(a.ts, 49, 11))
}
=== f.ts ===
export enum DiagnosticCategory {
>DiagnosticCategory : Symbol(DiagnosticCategory, Decl(f.ts, 53, 1))
>DiagnosticCategory : Symbol(DiagnosticCategory, Decl(f.ts, 0, 0))
Warning,
>Warning : Symbol(DiagnosticCategory.Warning, Decl(f.ts, 55, 32))
>Warning : Symbol(DiagnosticCategory.Warning, Decl(f.ts, 0, 32))
Error,
>Error : Symbol(DiagnosticCategory.Error, Decl(f.ts, 56, 12))
>Error : Symbol(DiagnosticCategory.Error, Decl(f.ts, 1, 12))
Suggestion,
>Suggestion : Symbol(DiagnosticCategory.Suggestion, Decl(f.ts, 57, 10))
>Suggestion : Symbol(DiagnosticCategory.Suggestion, Decl(f.ts, 2, 10))
Message,
>Message : Symbol(DiagnosticCategory.Message, Decl(f.ts, 58, 15))
>Message : Symbol(DiagnosticCategory.Message, Decl(f.ts, 3, 15))
}
export let x: DiagnosticCategory;
>x : Symbol(x, Decl(f.ts, 62, 10))
>DiagnosticCategory : Symbol(DiagnosticCategory, Decl(f.ts, 53, 1))
>x : Symbol(x, Decl(f.ts, 7, 10))
>DiagnosticCategory : Symbol(DiagnosticCategory, Decl(f.ts, 0, 0))
(() => {
enum DiagnosticCategory {
>DiagnosticCategory : Symbol(DiagnosticCategory, Decl(f.ts, 64, 8))
>DiagnosticCategory : Symbol(DiagnosticCategory, Decl(f.ts, 9, 8))
Warning = "Warning",
>Warning : Symbol(DiagnosticCategory.Warning, Decl(f.ts, 65, 29))
>Warning : Symbol(DiagnosticCategory.Warning, Decl(f.ts, 10, 29))
Error = "Error",
>Error : Symbol(DiagnosticCategory.Error, Decl(f.ts, 66, 28))
>Error : Symbol(DiagnosticCategory.Error, Decl(f.ts, 11, 28))
Suggestion = "Suggestion",
>Suggestion : Symbol(DiagnosticCategory.Suggestion, Decl(f.ts, 67, 24))
>Suggestion : Symbol(DiagnosticCategory.Suggestion, Decl(f.ts, 12, 24))
Message = "Message",
>Message : Symbol(DiagnosticCategory.Message, Decl(f.ts, 68, 34))
>Message : Symbol(DiagnosticCategory.Message, Decl(f.ts, 13, 34))
}
function f(y: DiagnosticCategory) {
>f : Symbol(f, Decl(f.ts, 70, 5))
>y : Symbol(y, Decl(f.ts, 71, 15))
>DiagnosticCategory : Symbol(DiagnosticCategory, Decl(f.ts, 64, 8))
>f : Symbol(f, Decl(f.ts, 15, 5))
>y : Symbol(y, Decl(f.ts, 16, 15))
>DiagnosticCategory : Symbol(DiagnosticCategory, Decl(f.ts, 9, 8))
x = y;
>x : Symbol(x, Decl(f.ts, 62, 10))
>y : Symbol(y, Decl(f.ts, 71, 15))
>x : Symbol(x, Decl(f.ts, 7, 10))
>y : Symbol(y, Decl(f.ts, 16, 15))
y = x;
>y : Symbol(y, Decl(f.ts, 71, 15))
>x : Symbol(x, Decl(f.ts, 62, 10))
>y : Symbol(y, Decl(f.ts, 16, 15))
>x : Symbol(x, Decl(f.ts, 7, 10))
}
})()
@@ -1,7 +1,6 @@
//// [tests/cases/compiler/enumAssignmentCompat6.ts] ////
=== f.ts ===
// @filename a.ts
=== a.ts ===
namespace numerics {
>numerics : typeof numerics
@@ -154,6 +153,7 @@ function i(x: strings.DiagnosticCategory, y: ambients.DiagnosticCategory) {
>x : strings.DiagnosticCategory
}
=== f.ts ===
export enum DiagnosticCategory {
>DiagnosticCategory : DiagnosticCategory
@@ -1,8 +1,6 @@
//// [tests/cases/compiler/exportDefaultProperty.ts] ////
//// [declarations.d.ts]
// This test is just like exportEqualsProperty, but with `export default`.
declare namespace foo.bar {
export type X = number;
export const X: number;
@@ -8,7 +8,7 @@ import fooBar from "foobar";
import X = fooBar.X;
>X : Symbol(X, Decl(index.ts, 1, 28))
>fooBar : Symbol(fooBar, Decl(index.ts, 1, 6))
>X : Symbol(fooBar.X, Decl(declarations.d.ts, 2, 27), Decl(declarations.d.ts, 4, 16))
>X : Symbol(fooBar.X, Decl(declarations.d.ts, 0, 27), Decl(declarations.d.ts, 2, 16))
import X2 from "foobarx";
>X2 : Symbol(X2, Decl(index.ts, 3, 6))
@@ -41,37 +41,35 @@ fooLength + 1;
>fooLength : Symbol(fooLength, Decl(index.ts, 10, 6))
=== declarations.d.ts ===
// This test is just like exportEqualsProperty, but with `export default`.
declare namespace foo.bar {
>foo : Symbol(foo, Decl(declarations.d.ts, 0, 0))
>bar : Symbol(bar, Decl(declarations.d.ts, 2, 22))
>bar : Symbol(bar, Decl(declarations.d.ts, 0, 22))
export type X = number;
>X : Symbol(X, Decl(declarations.d.ts, 2, 27), Decl(declarations.d.ts, 4, 16))
>X : Symbol(X, Decl(declarations.d.ts, 0, 27), Decl(declarations.d.ts, 2, 16))
export const X: number;
>X : Symbol(X, Decl(declarations.d.ts, 2, 27), Decl(declarations.d.ts, 4, 16))
>X : Symbol(X, Decl(declarations.d.ts, 0, 27), Decl(declarations.d.ts, 2, 16))
}
declare module "foobar" {
>"foobar" : Symbol("foobar", Decl(declarations.d.ts, 5, 1))
>"foobar" : Symbol("foobar", Decl(declarations.d.ts, 3, 1))
export default foo.bar;
>foo.bar : Symbol(foo.bar, Decl(declarations.d.ts, 2, 22))
>foo.bar : Symbol(foo.bar, Decl(declarations.d.ts, 0, 22))
>foo : Symbol(foo, Decl(declarations.d.ts, 0, 0))
>bar : Symbol(foo.bar, Decl(declarations.d.ts, 2, 22))
>bar : Symbol(foo.bar, Decl(declarations.d.ts, 0, 22))
}
declare module "foobarx" {
>"foobarx" : Symbol("foobarx", Decl(declarations.d.ts, 9, 1))
>"foobarx" : Symbol("foobarx", Decl(declarations.d.ts, 7, 1))
export default foo.bar.X;
>foo.bar.X : Symbol(foo.bar.X, Decl(declarations.d.ts, 2, 27), Decl(declarations.d.ts, 4, 16))
>foo.bar : Symbol(foo.bar, Decl(declarations.d.ts, 2, 22))
>foo.bar.X : Symbol(foo.bar.X, Decl(declarations.d.ts, 0, 27), Decl(declarations.d.ts, 2, 16))
>foo.bar : Symbol(foo.bar, Decl(declarations.d.ts, 0, 22))
>foo : Symbol(foo, Decl(declarations.d.ts, 0, 0))
>bar : Symbol(foo.bar, Decl(declarations.d.ts, 2, 22))
>X : Symbol(foo.bar.X, Decl(declarations.d.ts, 2, 27), Decl(declarations.d.ts, 4, 16))
>bar : Symbol(foo.bar, Decl(declarations.d.ts, 0, 22))
>X : Symbol(foo.bar.X, Decl(declarations.d.ts, 0, 27), Decl(declarations.d.ts, 2, 16))
}
=== a.ts ===
@@ -41,8 +41,6 @@ fooLength + 1;
>1 : 1
=== declarations.d.ts ===
// This test is just like exportEqualsProperty, but with `export default`.
declare namespace foo.bar {
>foo : typeof foo
>bar : typeof bar
@@ -1,8 +1,6 @@
//// [tests/cases/compiler/exportDefaultProperty2.ts] ////
//// [a.ts]
// This test is just like exportEqualsProperty2, but with `export default`.
class C {
static B: number;
}
@@ -19,7 +17,6 @@ const x: B = { c: B };
//// [a.js]
"use strict";
// This test is just like exportEqualsProperty2, but with `export default`.
Object.defineProperty(exports, "__esModule", { value: true });
var C = /** @class */ (function () {
function C() {
@@ -1,26 +1,24 @@
//// [tests/cases/compiler/exportDefaultProperty2.ts] ////
=== a.ts ===
// This test is just like exportEqualsProperty2, but with `export default`.
class C {
>C : Symbol(C, Decl(a.ts, 0, 0), Decl(a.ts, 4, 1))
>C : Symbol(C, Decl(a.ts, 0, 0), Decl(a.ts, 2, 1))
static B: number;
>B : Symbol(C.B, Decl(a.ts, 2, 9), Decl(a.ts, 5, 13))
>B : Symbol(C.B, Decl(a.ts, 0, 9), Decl(a.ts, 3, 13))
}
namespace C {
>C : Symbol(C, Decl(a.ts, 0, 0), Decl(a.ts, 4, 1))
>C : Symbol(C, Decl(a.ts, 0, 0), Decl(a.ts, 2, 1))
export interface B { c: number }
>B : Symbol(B, Decl(a.ts, 2, 9), Decl(a.ts, 5, 13))
>c : Symbol(B.c, Decl(a.ts, 6, 24))
>B : Symbol(B, Decl(a.ts, 0, 9), Decl(a.ts, 3, 13))
>c : Symbol(B.c, Decl(a.ts, 4, 24))
}
export default C.B;
>C.B : Symbol(C.B, Decl(a.ts, 2, 9), Decl(a.ts, 5, 13))
>C : Symbol(C, Decl(a.ts, 0, 0), Decl(a.ts, 4, 1))
>B : Symbol(C.B, Decl(a.ts, 2, 9), Decl(a.ts, 5, 13))
>C.B : Symbol(C.B, Decl(a.ts, 0, 9), Decl(a.ts, 3, 13))
>C : Symbol(C, Decl(a.ts, 0, 0), Decl(a.ts, 2, 1))
>B : Symbol(C.B, Decl(a.ts, 0, 9), Decl(a.ts, 3, 13))
=== b.ts ===
import B from "./a";
@@ -1,8 +1,6 @@
//// [tests/cases/compiler/exportDefaultProperty2.ts] ////
=== a.ts ===
// This test is just like exportEqualsProperty2, but with `export default`.
class C {
>C : C
@@ -1,8 +1,6 @@
//// [tests/cases/compiler/exportEqualsProperty.ts] ////
//// [declarations.d.ts]
// This test is just like exportDefaultProperty, but with `export =`.
declare namespace foo.bar {
export type X = number;
export const X: number;
@@ -36,37 +36,35 @@ fooLength + 1;
>fooLength : Symbol(fooLength, Decl(index.ts, 7, 24))
=== declarations.d.ts ===
// This test is just like exportDefaultProperty, but with `export =`.
declare namespace foo.bar {
>foo : Symbol(foo, Decl(declarations.d.ts, 0, 0))
>bar : Symbol(bar, Decl(declarations.d.ts, 2, 22))
>bar : Symbol(bar, Decl(declarations.d.ts, 0, 22))
export type X = number;
>X : Symbol(X, Decl(declarations.d.ts, 2, 27), Decl(declarations.d.ts, 4, 16))
>X : Symbol(X, Decl(declarations.d.ts, 0, 27), Decl(declarations.d.ts, 2, 16))
export const X: number;
>X : Symbol(X, Decl(declarations.d.ts, 2, 27), Decl(declarations.d.ts, 4, 16))
>X : Symbol(X, Decl(declarations.d.ts, 0, 27), Decl(declarations.d.ts, 2, 16))
}
declare module "foobar" {
>"foobar" : Symbol("foobar", Decl(declarations.d.ts, 5, 1))
>"foobar" : Symbol("foobar", Decl(declarations.d.ts, 3, 1))
export = foo.bar;
>foo.bar : Symbol(foo.bar, Decl(declarations.d.ts, 2, 22))
>foo.bar : Symbol(foo.bar, Decl(declarations.d.ts, 0, 22))
>foo : Symbol(foo, Decl(declarations.d.ts, 0, 0))
>bar : Symbol(foo.bar, Decl(declarations.d.ts, 2, 22))
>bar : Symbol(foo.bar, Decl(declarations.d.ts, 0, 22))
}
declare module "foobarx" {
>"foobarx" : Symbol("foobarx", Decl(declarations.d.ts, 9, 1))
>"foobarx" : Symbol("foobarx", Decl(declarations.d.ts, 7, 1))
export = foo.bar.X;
>foo.bar.X : Symbol(foo.bar.X, Decl(declarations.d.ts, 2, 27), Decl(declarations.d.ts, 4, 16))
>foo.bar : Symbol(foo.bar, Decl(declarations.d.ts, 2, 22))
>foo.bar.X : Symbol(foo.bar.X, Decl(declarations.d.ts, 0, 27), Decl(declarations.d.ts, 2, 16))
>foo.bar : Symbol(foo.bar, Decl(declarations.d.ts, 0, 22))
>foo : Symbol(foo, Decl(declarations.d.ts, 0, 0))
>bar : Symbol(foo.bar, Decl(declarations.d.ts, 2, 22))
>X : Symbol(foo.bar.X, Decl(declarations.d.ts, 2, 27), Decl(declarations.d.ts, 4, 16))
>bar : Symbol(foo.bar, Decl(declarations.d.ts, 0, 22))
>X : Symbol(foo.bar.X, Decl(declarations.d.ts, 0, 27), Decl(declarations.d.ts, 2, 16))
}
=== a.ts ===
@@ -36,8 +36,6 @@ fooLength + 1;
>1 : 1
=== declarations.d.ts ===
// This test is just like exportDefaultProperty, but with `export =`.
declare namespace foo.bar {
>foo : typeof foo
>bar : typeof bar
@@ -1,8 +1,6 @@
//// [tests/cases/compiler/exportEqualsProperty2.ts] ////
//// [a.ts]
// This test is just like exportDefaultProperty2, but with `export =`.
class C {
static B: number;
}
@@ -19,7 +17,6 @@ const x: B = { c: B };
//// [a.js]
"use strict";
// This test is just like exportDefaultProperty2, but with `export =`.
var C = /** @class */ (function () {
function C() {
}
@@ -11,24 +11,22 @@ const x: B = { c: B };
>B : Symbol(B, Decl(b.ts, 0, 0))
=== a.ts ===
// This test is just like exportDefaultProperty2, but with `export =`.
class C {
>C : Symbol(C, Decl(a.ts, 0, 0), Decl(a.ts, 4, 1))
>C : Symbol(C, Decl(a.ts, 0, 0), Decl(a.ts, 2, 1))
static B: number;
>B : Symbol(C.B, Decl(a.ts, 2, 9), Decl(a.ts, 5, 13))
>B : Symbol(C.B, Decl(a.ts, 0, 9), Decl(a.ts, 3, 13))
}
namespace C {
>C : Symbol(C, Decl(a.ts, 0, 0), Decl(a.ts, 4, 1))
>C : Symbol(C, Decl(a.ts, 0, 0), Decl(a.ts, 2, 1))
export interface B { c: number }
>B : Symbol(B, Decl(a.ts, 2, 9), Decl(a.ts, 5, 13))
>c : Symbol(B.c, Decl(a.ts, 6, 24))
>B : Symbol(B, Decl(a.ts, 0, 9), Decl(a.ts, 3, 13))
>c : Symbol(B.c, Decl(a.ts, 4, 24))
}
export = C.B;
>C.B : Symbol(C.B, Decl(a.ts, 2, 9), Decl(a.ts, 5, 13))
>C : Symbol(C, Decl(a.ts, 0, 0), Decl(a.ts, 4, 1))
>B : Symbol(C.B, Decl(a.ts, 2, 9), Decl(a.ts, 5, 13))
>C.B : Symbol(C.B, Decl(a.ts, 0, 9), Decl(a.ts, 3, 13))
>C : Symbol(C, Decl(a.ts, 0, 0), Decl(a.ts, 2, 1))
>B : Symbol(C.B, Decl(a.ts, 0, 9), Decl(a.ts, 3, 13))
@@ -11,8 +11,6 @@ const x: B = { c: B };
>B : number
=== a.ts ===
// This test is just like exportDefaultProperty2, but with `export =`.
class C {
>C : C
@@ -9,8 +9,6 @@
export class A extends Foo { }
==== /node_modules/foo/index.js (0 errors) ====
// Test that extending an untyped module is an error, unlike extending unknownSymbol.
This file is not read.
==== /node_modules/bar/index.js (0 errors) ====
@@ -1,8 +1,6 @@
//// [tests/cases/compiler/extendsUntypedModule.ts] ////
//// [index.js]
// Test that extending an untyped module is an error, unlike extending unknownSymbol.
This file is not read.
//// [index.js]
@@ -8,7 +8,6 @@ SubB.js(3,41): error TS8011: Type arguments can only be used in TypeScript files
==== BaseA.js (0 errors) ====
// regression test for #18254
export default class BaseA {
}
==== SubA.js (0 errors) ====
@@ -1,7 +1,6 @@
//// [tests/cases/compiler/fillInMissingTypeArgsOnJSConstructCalls.ts] ////
=== BaseA.js ===
// regression test for #18254
export default class BaseA {
>BaseA : Symbol(BaseA, Decl(BaseA.js, 0, 0))
}
@@ -1,7 +1,6 @@
//// [tests/cases/compiler/fillInMissingTypeArgsOnJSConstructCalls.ts] ////
=== BaseA.js ===
// regression test for #18254
export default class BaseA {
>BaseA : BaseA
}
@@ -1,8 +1,6 @@
//// [tests/cases/compiler/importPropertyFromMappedType.ts] ////
//// [errors.d.ts]
// #42957
export = createHttpError;
declare const createHttpError: createHttpError.NamedConstructors;
declare namespace createHttpError {
@@ -1,22 +1,20 @@
//// [tests/cases/compiler/importPropertyFromMappedType.ts] ////
=== errors.d.ts ===
// #42957
export = createHttpError;
>createHttpError : Symbol(createHttpError, Decl(errors.d.ts, 3, 13), Decl(errors.d.ts, 3, 65))
>createHttpError : Symbol(createHttpError, Decl(errors.d.ts, 1, 13), Decl(errors.d.ts, 1, 65))
declare const createHttpError: createHttpError.NamedConstructors;
>createHttpError : Symbol(createHttpError, Decl(errors.d.ts, 3, 13), Decl(errors.d.ts, 3, 65))
>createHttpError : Symbol(createHttpError, Decl(errors.d.ts, 3, 13), Decl(errors.d.ts, 3, 65))
>NamedConstructors : Symbol(createHttpError.NamedConstructors, Decl(errors.d.ts, 4, 35))
>createHttpError : Symbol(createHttpError, Decl(errors.d.ts, 1, 13), Decl(errors.d.ts, 1, 65))
>createHttpError : Symbol(createHttpError, Decl(errors.d.ts, 1, 13), Decl(errors.d.ts, 1, 65))
>NamedConstructors : Symbol(createHttpError.NamedConstructors, Decl(errors.d.ts, 2, 35))
declare namespace createHttpError {
>createHttpError : Symbol(createHttpError, Decl(errors.d.ts, 3, 13), Decl(errors.d.ts, 3, 65))
>createHttpError : Symbol(createHttpError, Decl(errors.d.ts, 1, 13), Decl(errors.d.ts, 1, 65))
type NamedConstructors = { [P in 'NotFound']: unknown;}
>NamedConstructors : Symbol(NamedConstructors, Decl(errors.d.ts, 4, 35))
>P : Symbol(P, Decl(errors.d.ts, 5, 33))
>NamedConstructors : Symbol(NamedConstructors, Decl(errors.d.ts, 2, 35))
>P : Symbol(P, Decl(errors.d.ts, 3, 33))
}
=== main.ts ===
@@ -1,8 +1,6 @@
//// [tests/cases/compiler/importPropertyFromMappedType.ts] ////
=== errors.d.ts ===
// #42957
export = createHttpError;
>createHttpError : createHttpError.NamedConstructors
@@ -2,9 +2,6 @@
==== /a.js (0 errors) ====
// https://github.com/microsoft/TypeScript/issues/34481
const alias = {};
module.exports = alias;
@@ -12,5 +9,5 @@
import a from "./a";
~
!!! error TS1259: Module '"/a"' can only be default-imported using the 'esModuleInterop' flag
!!! related TS2594 /a.js:5:1: This module is declared with 'export =', and can only be used with a default import when using the 'esModuleInterop' flag.
!!! related TS2594 /a.js:2:1: This module is declared with 'export =', and can only be used with a default import when using the 'esModuleInterop' flag.
@@ -1,17 +1,14 @@
//// [tests/cases/compiler/javascriptImportDefaultBadExport.ts] ////
=== /a.js ===
// https://github.com/microsoft/TypeScript/issues/34481
const alias = {};
>alias : Symbol(alias, Decl(a.js, 3, 5))
>alias : Symbol(alias, Decl(a.js, 0, 5))
module.exports = alias;
>module.exports : Symbol(module.exports, Decl(a.js, 0, 0))
>module : Symbol(export=, Decl(a.js, 3, 17))
>exports : Symbol(export=, Decl(a.js, 3, 17))
>alias : Symbol(alias, Decl(a.js, 3, 5))
>module : Symbol(export=, Decl(a.js, 0, 17))
>exports : Symbol(export=, Decl(a.js, 0, 17))
>alias : Symbol(alias, Decl(a.js, 0, 5))
=== /b.js ===
import a from "./a";
@@ -1,9 +1,6 @@
//// [tests/cases/compiler/javascriptImportDefaultBadExport.ts] ////
=== /a.js ===
// https://github.com/microsoft/TypeScript/issues/34481
const alias = {};
>alias : {}
>{} : {}
@@ -1,20 +1,19 @@
//// [tests/cases/conformance/salsa/jsContainerMergeJsContainer.ts] ////
=== a.js ===
// #24131
const a = {};
>a : Symbol(a, Decl(a.js, 1, 5), Decl(a.js, 1, 13), Decl(b.js, 0, 0))
>a : Symbol(a, Decl(a.js, 0, 5), Decl(a.js, 0, 13), Decl(b.js, 0, 0))
a.d = function() {};
>a.d : Symbol(a.d, Decl(a.js, 1, 13), Decl(b.js, 0, 2))
>a : Symbol(a, Decl(a.js, 1, 5), Decl(a.js, 1, 13), Decl(b.js, 0, 0))
>d : Symbol(a.d, Decl(a.js, 1, 13), Decl(b.js, 0, 2))
>a.d : Symbol(a.d, Decl(a.js, 0, 13), Decl(b.js, 0, 2))
>a : Symbol(a, Decl(a.js, 0, 5), Decl(a.js, 0, 13), Decl(b.js, 0, 0))
>d : Symbol(a.d, Decl(a.js, 0, 13), Decl(b.js, 0, 2))
=== b.js ===
a.d.prototype = {};
>a.d.prototype : Symbol(a.d.prototype, Decl(b.js, 0, 0))
>a.d : Symbol(a.d, Decl(a.js, 1, 13), Decl(b.js, 0, 2))
>a : Symbol(a, Decl(a.js, 1, 5), Decl(a.js, 1, 13), Decl(b.js, 0, 0))
>d : Symbol(a.d, Decl(a.js, 1, 13), Decl(b.js, 0, 2))
>a.d : Symbol(a.d, Decl(a.js, 0, 13), Decl(b.js, 0, 2))
>a : Symbol(a, Decl(a.js, 0, 5), Decl(a.js, 0, 13), Decl(b.js, 0, 0))
>d : Symbol(a.d, Decl(a.js, 0, 13), Decl(b.js, 0, 2))
>prototype : Symbol(a.d.prototype, Decl(b.js, 0, 0))
@@ -1,7 +1,6 @@
//// [tests/cases/conformance/salsa/jsContainerMergeJsContainer.ts] ////
=== a.js ===
// #24131
const a = {};
>a : typeof a
>{} : {}
@@ -1,23 +1,21 @@
//// [tests/cases/conformance/jsdoc/declarations/jsDeclarationsTypedefAndLatebound.ts] ////
=== index.js ===
// from #53967, based on webpack/webpack#16957
const LazySet = require("./LazySet");
>LazySet : Symbol(LazySet, Decl(index.js, 2, 5))
>LazySet : Symbol(LazySet, Decl(index.js, 0, 5))
>require : Symbol(require)
>"./LazySet" : Symbol("LazySet", Decl(LazySet.js, 0, 0))
/** @type {LazySet} */
const stringSet = undefined;
>stringSet : Symbol(stringSet, Decl(index.js, 5, 5))
>stringSet : Symbol(stringSet, Decl(index.js, 3, 5))
>undefined : Symbol(undefined)
stringSet.addAll(stringSet);
>stringSet.addAll : Symbol(LazySet.addAll, Decl(LazySet.js, 4, 15))
>stringSet : Symbol(stringSet, Decl(index.js, 5, 5))
>stringSet : Symbol(stringSet, Decl(index.js, 3, 5))
>addAll : Symbol(LazySet.addAll, Decl(LazySet.js, 4, 15))
>stringSet : Symbol(stringSet, Decl(index.js, 5, 5))
>stringSet : Symbol(stringSet, Decl(index.js, 3, 5))
=== LazySet.js ===
@@ -1,8 +1,6 @@
//// [tests/cases/conformance/jsdoc/declarations/jsDeclarationsTypedefAndLatebound.ts] ////
=== index.js ===
// from #53967, based on webpack/webpack#16957
const LazySet = require("./LazySet");
>LazySet : typeof LazySet
>require("./LazySet") : typeof LazySet
@@ -1,10 +1,6 @@
//// [tests/cases/compiler/jsEmitIntersectionProperty.ts] ////
//// [globals.d.ts]
// #37015 - test asserts lack of crash
declare class CoreObject {
static extend<
Statics,
@@ -2,8 +2,6 @@ Main.js(2,21): error TS2352: Conversion of type 'string' to type 'typeof _defaul
==== GeometryType.d.ts (0 errors) ====
// #40767
declare namespace _default {
export const POINT: string;
}
@@ -1,13 +1,11 @@
//// [tests/cases/compiler/jsdocImportTypeNodeNamespace.ts] ////
=== GeometryType.d.ts ===
// #40767
declare namespace _default {
>_default : Symbol(_default, Decl(GeometryType.d.ts, 0, 0))
export const POINT: string;
>POINT : Symbol(POINT, Decl(GeometryType.d.ts, 3, 14))
>POINT : Symbol(POINT, Decl(GeometryType.d.ts, 1, 14))
}
export default _default;
>_default : Symbol(_default, Decl(GeometryType.d.ts, 0, 0))
@@ -1,8 +1,6 @@
//// [tests/cases/compiler/jsdocImportTypeNodeNamespace.ts] ////
=== GeometryType.d.ts ===
// #40767
declare namespace _default {
>_default : typeof _default
@@ -1,17 +1,15 @@
//// [tests/cases/conformance/jsdoc/jsdocTypeReferenceToImport.ts] ////
=== jsdocTypeReferenceToImport.js ===
// #34802
const C = require('./ex').C;
>C : Symbol(C, Decl(jsdocTypeReferenceToImport.js, 2, 5))
>C : Symbol(C, Decl(jsdocTypeReferenceToImport.js, 0, 5))
>require('./ex').C : Symbol(C, Decl(ex.d.ts, 0, 0))
>require : Symbol(require)
>'./ex' : Symbol("ex", Decl(ex.d.ts, 0, 0))
>C : Symbol(C, Decl(ex.d.ts, 0, 0))
const D = require('./ex')?.C;
>D : Symbol(D, Decl(jsdocTypeReferenceToImport.js, 3, 5))
>D : Symbol(D, Decl(jsdocTypeReferenceToImport.js, 1, 5))
>require('./ex')?.C : Symbol(C, Decl(ex.d.ts, 0, 0))
>require : Symbol(require)
>'./ex' : Symbol("ex", Decl(ex.d.ts, 0, 0))
@@ -19,32 +17,32 @@ const D = require('./ex')?.C;
/** @type {C} c */
var c = new C()
>c : Symbol(c, Decl(jsdocTypeReferenceToImport.js, 5, 3))
>C : Symbol(C, Decl(jsdocTypeReferenceToImport.js, 2, 5))
>c : Symbol(c, Decl(jsdocTypeReferenceToImport.js, 3, 3))
>C : Symbol(C, Decl(jsdocTypeReferenceToImport.js, 0, 5))
c.start
>c.start : Symbol(C.start, Decl(ex.d.ts, 0, 16))
>c : Symbol(c, Decl(jsdocTypeReferenceToImport.js, 5, 3))
>c : Symbol(c, Decl(jsdocTypeReferenceToImport.js, 3, 3))
>start : Symbol(C.start, Decl(ex.d.ts, 0, 16))
c.end
>c.end : Symbol(C.end, Decl(ex.d.ts, 1, 17))
>c : Symbol(c, Decl(jsdocTypeReferenceToImport.js, 5, 3))
>c : Symbol(c, Decl(jsdocTypeReferenceToImport.js, 3, 3))
>end : Symbol(C.end, Decl(ex.d.ts, 1, 17))
/** @type {D} c */
var d = new D()
>d : Symbol(d, Decl(jsdocTypeReferenceToImport.js, 10, 3))
>D : Symbol(D, Decl(jsdocTypeReferenceToImport.js, 3, 5))
>d : Symbol(d, Decl(jsdocTypeReferenceToImport.js, 8, 3))
>D : Symbol(D, Decl(jsdocTypeReferenceToImport.js, 1, 5))
d.start
>d.start : Symbol(C.start, Decl(ex.d.ts, 0, 16))
>d : Symbol(d, Decl(jsdocTypeReferenceToImport.js, 10, 3))
>d : Symbol(d, Decl(jsdocTypeReferenceToImport.js, 8, 3))
>start : Symbol(C.start, Decl(ex.d.ts, 0, 16))
d.end
>d.end : Symbol(C.end, Decl(ex.d.ts, 1, 17))
>d : Symbol(d, Decl(jsdocTypeReferenceToImport.js, 10, 3))
>d : Symbol(d, Decl(jsdocTypeReferenceToImport.js, 8, 3))
>end : Symbol(C.end, Decl(ex.d.ts, 1, 17))
=== ex.d.ts ===
@@ -1,8 +1,6 @@
//// [tests/cases/conformance/jsdoc/jsdocTypeReferenceToImport.ts] ////
=== jsdocTypeReferenceToImport.js ===
// #34802
const C = require('./ex').C;
>C : typeof C
>require('./ex').C : typeof C
@@ -1,34 +1,32 @@
//// [tests/cases/conformance/jsdoc/jsdocTypeReferenceToMergedClass.ts] ////
=== jsdocTypeReferenceToMergedClass.js ===
// https://github.com/microsoft/TypeScript/issues/34685
var Workspace = {}
>Workspace : Symbol(Workspace, Decl(jsdocTypeReferenceToMergedClass.js, 2, 3), Decl(jsdocTypeReferenceToMergedClass.js, 5, 20), Decl(jsdocTypeReferenceToMergedClass.js, 7, 37))
>Workspace : Symbol(Workspace, Decl(jsdocTypeReferenceToMergedClass.js, 0, 3), Decl(jsdocTypeReferenceToMergedClass.js, 3, 20), Decl(jsdocTypeReferenceToMergedClass.js, 5, 37))
/** @type {Workspace.Project} */
var p;
>p : Symbol(p, Decl(jsdocTypeReferenceToMergedClass.js, 4, 3))
>p : Symbol(p, Decl(jsdocTypeReferenceToMergedClass.js, 2, 3))
p.isServiceProject()
>p.isServiceProject : Symbol(isServiceProject, Decl(jsdocTypeReferenceToMergedClass.js, 8, 31))
>p : Symbol(p, Decl(jsdocTypeReferenceToMergedClass.js, 4, 3))
>isServiceProject : Symbol(isServiceProject, Decl(jsdocTypeReferenceToMergedClass.js, 8, 31))
>p.isServiceProject : Symbol(isServiceProject, Decl(jsdocTypeReferenceToMergedClass.js, 6, 31))
>p : Symbol(p, Decl(jsdocTypeReferenceToMergedClass.js, 2, 3))
>isServiceProject : Symbol(isServiceProject, Decl(jsdocTypeReferenceToMergedClass.js, 6, 31))
Workspace.Project = function wp() { }
>Workspace.Project : Symbol(Workspace.Project, Decl(jsdocTypeReferenceToMergedClass.js, 5, 20), Decl(jsdocTypeReferenceToMergedClass.js, 8, 10))
>Workspace : Symbol(Workspace, Decl(jsdocTypeReferenceToMergedClass.js, 2, 3), Decl(jsdocTypeReferenceToMergedClass.js, 5, 20), Decl(jsdocTypeReferenceToMergedClass.js, 7, 37))
>Project : Symbol(Workspace.Project, Decl(jsdocTypeReferenceToMergedClass.js, 5, 20), Decl(jsdocTypeReferenceToMergedClass.js, 8, 10))
>wp : Symbol(wp, Decl(jsdocTypeReferenceToMergedClass.js, 7, 19))
>Workspace.Project : Symbol(Workspace.Project, Decl(jsdocTypeReferenceToMergedClass.js, 3, 20), Decl(jsdocTypeReferenceToMergedClass.js, 6, 10))
>Workspace : Symbol(Workspace, Decl(jsdocTypeReferenceToMergedClass.js, 0, 3), Decl(jsdocTypeReferenceToMergedClass.js, 3, 20), Decl(jsdocTypeReferenceToMergedClass.js, 5, 37))
>Project : Symbol(Workspace.Project, Decl(jsdocTypeReferenceToMergedClass.js, 3, 20), Decl(jsdocTypeReferenceToMergedClass.js, 6, 10))
>wp : Symbol(wp, Decl(jsdocTypeReferenceToMergedClass.js, 5, 19))
Workspace.Project.prototype = {
>Workspace.Project.prototype : Symbol(Workspace.Project.prototype, Decl(jsdocTypeReferenceToMergedClass.js, 7, 37))
>Workspace.Project : Symbol(Workspace.Project, Decl(jsdocTypeReferenceToMergedClass.js, 5, 20), Decl(jsdocTypeReferenceToMergedClass.js, 8, 10))
>Workspace : Symbol(Workspace, Decl(jsdocTypeReferenceToMergedClass.js, 2, 3), Decl(jsdocTypeReferenceToMergedClass.js, 5, 20), Decl(jsdocTypeReferenceToMergedClass.js, 7, 37))
>Project : Symbol(Workspace.Project, Decl(jsdocTypeReferenceToMergedClass.js, 5, 20), Decl(jsdocTypeReferenceToMergedClass.js, 8, 10))
>prototype : Symbol(Workspace.Project.prototype, Decl(jsdocTypeReferenceToMergedClass.js, 7, 37))
>Workspace.Project.prototype : Symbol(Workspace.Project.prototype, Decl(jsdocTypeReferenceToMergedClass.js, 5, 37))
>Workspace.Project : Symbol(Workspace.Project, Decl(jsdocTypeReferenceToMergedClass.js, 3, 20), Decl(jsdocTypeReferenceToMergedClass.js, 6, 10))
>Workspace : Symbol(Workspace, Decl(jsdocTypeReferenceToMergedClass.js, 0, 3), Decl(jsdocTypeReferenceToMergedClass.js, 3, 20), Decl(jsdocTypeReferenceToMergedClass.js, 5, 37))
>Project : Symbol(Workspace.Project, Decl(jsdocTypeReferenceToMergedClass.js, 3, 20), Decl(jsdocTypeReferenceToMergedClass.js, 6, 10))
>prototype : Symbol(Workspace.Project.prototype, Decl(jsdocTypeReferenceToMergedClass.js, 5, 37))
isServiceProject() {}
>isServiceProject : Symbol(isServiceProject, Decl(jsdocTypeReferenceToMergedClass.js, 8, 31))
>isServiceProject : Symbol(isServiceProject, Decl(jsdocTypeReferenceToMergedClass.js, 6, 31))
}
@@ -1,8 +1,6 @@
//// [tests/cases/conformance/jsdoc/jsdocTypeReferenceToMergedClass.ts] ////
=== jsdocTypeReferenceToMergedClass.js ===
// https://github.com/microsoft/TypeScript/issues/34685
var Workspace = {}
>Workspace : typeof Workspace
>{} : {}
@@ -1,8 +1,6 @@
//// [tests/cases/conformance/declarationEmit/libReferenceNoLib.ts] ////
//// [fakelib.ts]
// Test that passing noLib disables <reference lib> resolution.
interface Object { }
interface Array<T> { }
interface String { }
@@ -20,7 +18,6 @@ export const elem: HTMLElement = { field: 'a' };
//// [fakelib.js]
// Test that passing noLib disables <reference lib> resolution.
//// [file1.js]
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,32 +1,30 @@
//// [tests/cases/conformance/declarationEmit/libReferenceNoLib.ts] ////
=== fakelib.ts ===
// Test that passing noLib disables <reference lib> resolution.
interface Object { }
>Object : Symbol(Object, Decl(fakelib.ts, 0, 0))
interface Array<T> { }
>Array : Symbol(Array, Decl(fakelib.ts, 2, 20))
>T : Symbol(T, Decl(fakelib.ts, 3, 16))
>Array : Symbol(Array, Decl(fakelib.ts, 0, 20))
>T : Symbol(T, Decl(fakelib.ts, 1, 16))
interface String { }
>String : Symbol(String, Decl(fakelib.ts, 3, 22))
>String : Symbol(String, Decl(fakelib.ts, 1, 22))
interface Boolean { }
>Boolean : Symbol(Boolean, Decl(fakelib.ts, 4, 20))
>Boolean : Symbol(Boolean, Decl(fakelib.ts, 2, 20))
interface Number { }
>Number : Symbol(Number, Decl(fakelib.ts, 5, 21))
>Number : Symbol(Number, Decl(fakelib.ts, 3, 21))
interface Function { }
>Function : Symbol(Function, Decl(fakelib.ts, 6, 20))
>Function : Symbol(Function, Decl(fakelib.ts, 4, 20))
interface RegExp { }
>RegExp : Symbol(RegExp, Decl(fakelib.ts, 7, 22))
>RegExp : Symbol(RegExp, Decl(fakelib.ts, 5, 22))
interface IArguments { }
>IArguments : Symbol(IArguments, Decl(fakelib.ts, 8, 20))
>IArguments : Symbol(IArguments, Decl(fakelib.ts, 6, 20))
=== file1.ts ===
@@ -2,8 +2,6 @@
=== fakelib.ts ===
// Test that passing noLib disables <reference lib> resolution.
interface Object { }
interface Array<T> { }
interface String { }
@@ -1,8 +1,6 @@
//// [tests/cases/conformance/declarationEmit/libReferenceNoLibBundle.ts] ////
//// [fakelib.ts]
// Test that passing noLib disables <reference lib> resolution.
interface Object { }
interface Array<T> { }
interface String { }
@@ -20,7 +18,6 @@ export const elem: HTMLElement = { field: 'a' };
//// [bundle.js]
// Test that passing noLib disables <reference lib> resolution.
define("file1", ["require", "exports"], function (require, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,32 +1,30 @@
//// [tests/cases/conformance/declarationEmit/libReferenceNoLibBundle.ts] ////
=== fakelib.ts ===
// Test that passing noLib disables <reference lib> resolution.
interface Object { }
>Object : Symbol(Object, Decl(fakelib.ts, 0, 0))
interface Array<T> { }
>Array : Symbol(Array, Decl(fakelib.ts, 2, 20))
>T : Symbol(T, Decl(fakelib.ts, 3, 16))
>Array : Symbol(Array, Decl(fakelib.ts, 0, 20))
>T : Symbol(T, Decl(fakelib.ts, 1, 16))
interface String { }
>String : Symbol(String, Decl(fakelib.ts, 3, 22))
>String : Symbol(String, Decl(fakelib.ts, 1, 22))
interface Boolean { }
>Boolean : Symbol(Boolean, Decl(fakelib.ts, 4, 20))
>Boolean : Symbol(Boolean, Decl(fakelib.ts, 2, 20))
interface Number { }
>Number : Symbol(Number, Decl(fakelib.ts, 5, 21))
>Number : Symbol(Number, Decl(fakelib.ts, 3, 21))
interface Function { }
>Function : Symbol(Function, Decl(fakelib.ts, 6, 20))
>Function : Symbol(Function, Decl(fakelib.ts, 4, 20))
interface RegExp { }
>RegExp : Symbol(RegExp, Decl(fakelib.ts, 7, 22))
>RegExp : Symbol(RegExp, Decl(fakelib.ts, 5, 22))
interface IArguments { }
>IArguments : Symbol(IArguments, Decl(fakelib.ts, 8, 20))
>IArguments : Symbol(IArguments, Decl(fakelib.ts, 6, 20))
=== file1.ts ===
@@ -2,8 +2,6 @@
=== fakelib.ts ===
// Test that passing noLib disables <reference lib> resolution.
interface Object { }
interface Array<T> { }
interface String { }
@@ -1,8 +1,6 @@
//// [tests/cases/conformance/references/library-reference-1.ts] ////
//// [index.d.ts]
// We can find typings in the ./types folder
declare var $: { foo(): void };
@@ -3,15 +3,13 @@
=== /src/consumer.ts ===
/// <reference types="jquery" />
$.foo();
>$.foo : Symbol(foo, Decl(index.d.ts, 2, 16))
>$ : Symbol($, Decl(index.d.ts, 2, 11))
>foo : Symbol(foo, Decl(index.d.ts, 2, 16))
>$.foo : Symbol(foo, Decl(index.d.ts, 0, 16))
>$ : Symbol($, Decl(index.d.ts, 0, 11))
>foo : Symbol(foo, Decl(index.d.ts, 0, 16))
=== /src/types/jquery/index.d.ts ===
// We can find typings in the ./types folder
declare var $: { foo(): void };
>$ : Symbol($, Decl(index.d.ts, 2, 11))
>foo : Symbol(foo, Decl(index.d.ts, 2, 16))
>$ : Symbol($, Decl(index.d.ts, 0, 11))
>foo : Symbol(foo, Decl(index.d.ts, 0, 16))
@@ -9,8 +9,6 @@ $.foo();
>foo : () => void
=== /src/types/jquery/index.d.ts ===
// We can find typings in the ./types folder
declare var $: { foo(): void };
>$ : { foo(): void; }
>foo : () => void
@@ -1,8 +1,6 @@
//// [tests/cases/conformance/references/library-reference-10.ts] ////
//// [package.json]
// package.json in a primary reference can refer to another file
{
"typings": "jquery.d.ts"
}
@@ -1,8 +1,6 @@
//// [tests/cases/conformance/references/library-reference-11.ts] ////
//// [package.json]
// package.json in a secondary reference can refer to another file
{
"typings": "jquery.d.ts"
}
@@ -1,8 +1,6 @@
//// [tests/cases/conformance/references/library-reference-12.ts] ////
//// [package.json]
// package.json in a secondary reference can refer to another file
{
"types": "dist/jquery.d.ts"
}
@@ -1,8 +1,6 @@
//// [tests/cases/conformance/references/library-reference-2.ts] ////
//// [package.json]
// package.json in a primary reference can refer to another file
{
"types": "jquery.d.ts"
}
@@ -1,8 +1,6 @@
//// [tests/cases/conformance/references/library-reference-3.ts] ////
//// [index.d.ts]
// Secondary references are possible
declare var $: { foo(): void };
//// [consumer.ts]
@@ -3,14 +3,12 @@
=== /src/consumer.ts ===
/// <reference types="jquery" />
$.foo();
>$.foo : Symbol(foo, Decl(index.d.ts, 2, 16))
>$ : Symbol($, Decl(index.d.ts, 2, 11))
>foo : Symbol(foo, Decl(index.d.ts, 2, 16))
>$.foo : Symbol(foo, Decl(index.d.ts, 0, 16))
>$ : Symbol($, Decl(index.d.ts, 0, 11))
>foo : Symbol(foo, Decl(index.d.ts, 0, 16))
=== /src/node_modules/jquery/index.d.ts ===
// Secondary references are possible
declare var $: { foo(): void };
>$ : Symbol($, Decl(index.d.ts, 2, 11))
>foo : Symbol(foo, Decl(index.d.ts, 2, 16))
>$ : Symbol($, Decl(index.d.ts, 0, 11))
>foo : Symbol(foo, Decl(index.d.ts, 0, 16))
@@ -9,8 +9,6 @@ $.foo();
>foo : () => void
=== /src/node_modules/jquery/index.d.ts ===
// Secondary references are possible
declare var $: { foo(): void };
>$ : { foo(): void; }
>foo : () => void
@@ -1,8 +1,6 @@
//// [tests/cases/conformance/references/library-reference-4.ts] ////
//// [index.d.ts]
// Secondary references may be duplicated if they agree in content
/// <reference types="alpha" />
declare var foo: any;
@@ -6,11 +6,9 @@
/// <reference types="bar" />
=== /node_modules/foo/index.d.ts ===
// Secondary references may be duplicated if they agree in content
/// <reference types="alpha" />
declare var foo: any;
>foo : Symbol(foo, Decl(index.d.ts, 3, 11))
>foo : Symbol(foo, Decl(index.d.ts, 1, 11))
=== /node_modules/foo/node_modules/alpha/index.d.ts ===
declare var alpha: any;
@@ -6,8 +6,6 @@
/// <reference types="bar" />
=== /node_modules/foo/index.d.ts ===
// Secondary references may be duplicated if they agree in content
/// <reference types="alpha" />
declare var foo: any;
>foo : any
@@ -9,8 +9,6 @@
/// <reference types="bar" />
==== /node_modules/foo/index.d.ts (0 errors) ====
// Secondary references may not be duplicated if they disagree in content
/// <reference types="alpha" />
declare var foo: any;
@@ -24,7 +22,7 @@
!!! error TS4090: The file is in the program because:
!!! error TS4090: Type library referenced via 'alpha' from file '/node_modules/foo/index.d.ts'
!!! error TS4090: Type library referenced via 'alpha' from file '/node_modules/bar/index.d.ts'
!!! related TS1404 /node_modules/foo/index.d.ts:3:23: File is included via type library reference here.
!!! related TS1404 /node_modules/foo/index.d.ts:1:23: File is included via type library reference here.
declare var bar: any;
==== /node_modules/bar/node_modules/alpha/index.d.ts (0 errors) ====
@@ -1,8 +1,6 @@
//// [tests/cases/conformance/references/library-reference-5.ts] ////
//// [index.d.ts]
// Secondary references may not be duplicated if they disagree in content
/// <reference types="alpha" />
declare var foo: any;
@@ -6,11 +6,9 @@
/// <reference types="bar" />
=== /node_modules/foo/index.d.ts ===
// Secondary references may not be duplicated if they disagree in content
/// <reference types="alpha" />
declare var foo: any;
>foo : Symbol(foo, Decl(index.d.ts, 3, 11))
>foo : Symbol(foo, Decl(index.d.ts, 1, 11))
=== /node_modules/foo/node_modules/alpha/index.d.ts ===
declare var alpha: any;
@@ -6,8 +6,6 @@
/// <reference types="bar" />
=== /node_modules/foo/index.d.ts ===
// Secondary references may not be duplicated if they disagree in content
/// <reference types="alpha" />
declare var foo: any;
>foo : any
@@ -1,8 +1,6 @@
//// [tests/cases/conformance/references/library-reference-6.ts] ////
//// [index.d.ts]
// The primary lookup folder is relative to tsconfig.json, if present
declare var alpha: { a: string };
//// [foo.ts]
@@ -4,14 +4,12 @@
/// <reference types="alpha" />
var x: string = alpha.a;
>x : Symbol(x, Decl(foo.ts, 1, 3))
>alpha.a : Symbol(a, Decl(index.d.ts, 2, 20))
>alpha : Symbol(alpha, Decl(index.d.ts, 2, 11))
>a : Symbol(a, Decl(index.d.ts, 2, 20))
>alpha.a : Symbol(a, Decl(index.d.ts, 0, 20))
>alpha : Symbol(alpha, Decl(index.d.ts, 0, 11))
>a : Symbol(a, Decl(index.d.ts, 0, 20))
=== /node_modules/@types/alpha/index.d.ts ===
// The primary lookup folder is relative to tsconfig.json, if present
declare var alpha: { a: string };
>alpha : Symbol(alpha, Decl(index.d.ts, 2, 11))
>a : Symbol(a, Decl(index.d.ts, 2, 20))
>alpha : Symbol(alpha, Decl(index.d.ts, 0, 11))
>a : Symbol(a, Decl(index.d.ts, 0, 20))
@@ -9,8 +9,6 @@ var x: string = alpha.a;
>a : string
=== /node_modules/@types/alpha/index.d.ts ===
// The primary lookup folder is relative to tsconfig.json, if present
declare var alpha: { a: string };
>alpha : { a: string; }
>a : string
@@ -1,8 +1,6 @@
//// [tests/cases/conformance/references/library-reference-7.ts] ////
//// [index.d.ts]
// Secondary references are possible
declare var $: { foo(): void };
//// [consumer.ts]
@@ -3,14 +3,12 @@
=== /src/consumer.ts ===
/// <reference types="jquery" />
$.foo();
>$.foo : Symbol(foo, Decl(index.d.ts, 2, 16))
>$ : Symbol($, Decl(index.d.ts, 2, 11))
>foo : Symbol(foo, Decl(index.d.ts, 2, 16))
>$.foo : Symbol(foo, Decl(index.d.ts, 0, 16))
>$ : Symbol($, Decl(index.d.ts, 0, 11))
>foo : Symbol(foo, Decl(index.d.ts, 0, 16))
=== /src/node_modules/jquery/index.d.ts ===
// Secondary references are possible
declare var $: { foo(): void };
>$ : Symbol($, Decl(index.d.ts, 2, 11))
>foo : Symbol(foo, Decl(index.d.ts, 2, 16))
>$ : Symbol($, Decl(index.d.ts, 0, 11))
>foo : Symbol(foo, Decl(index.d.ts, 0, 16))
@@ -9,8 +9,6 @@ $.foo();
>foo : () => void
=== /src/node_modules/jquery/index.d.ts ===
// Secondary references are possible
declare var $: { foo(): void };
>$ : { foo(): void; }
>foo : () => void
@@ -1,8 +1,6 @@
//// [tests/cases/conformance/references/library-reference-8.ts] ////
//// [index.d.ts]
// Don't crash in circular library reference situations
/// <reference types="beta" />
declare var alpha: { a: string };
@@ -5,21 +5,19 @@
/// <reference types="beta" />
var x: string = alpha.a + beta.b;
>x : Symbol(x, Decl(foo.ts, 2, 3))
>alpha.a : Symbol(a, Decl(index.d.ts, 3, 20))
>alpha : Symbol(alpha, Decl(index.d.ts, 3, 11))
>a : Symbol(a, Decl(index.d.ts, 3, 20))
>alpha.a : Symbol(a, Decl(index.d.ts, 1, 20))
>alpha : Symbol(alpha, Decl(index.d.ts, 1, 11))
>a : Symbol(a, Decl(index.d.ts, 1, 20))
>beta.b : Symbol(b, Decl(index.d.ts, 1, 19))
>beta : Symbol(beta, Decl(index.d.ts, 1, 11))
>b : Symbol(b, Decl(index.d.ts, 1, 19))
=== /test/types/alpha/index.d.ts ===
// Don't crash in circular library reference situations
/// <reference types="beta" />
declare var alpha: { a: string };
>alpha : Symbol(alpha, Decl(index.d.ts, 3, 11))
>a : Symbol(a, Decl(index.d.ts, 3, 20))
>alpha : Symbol(alpha, Decl(index.d.ts, 1, 11))
>a : Symbol(a, Decl(index.d.ts, 1, 20))
=== /test/types/beta/index.d.ts ===
/// <reference types="alpha" />
@@ -15,8 +15,6 @@ var x: string = alpha.a + beta.b;
=== /test/types/alpha/index.d.ts ===
// Don't crash in circular library reference situations
/// <reference types="beta" />
declare var alpha: { a: string };
>alpha : { a: string; }
@@ -4,8 +4,6 @@ user.ts(3,15): error TS2846: A declaration file cannot be imported without 'impo
==== x.ts (0 errors) ====
// CommonJS output
export default 0;
==== y.tsx (0 errors) ====

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