In source files and blocks, bind function declarations before other statements (#22766)

* Add test case and temporarily disable inference

(Inference of class members from this-assignments inside a
prototype-assigned function.)

* Update baselines

* In blocks and source files, bind functions first

* Add tests from other bugs

* Remove temporary failsafe

* Update tests to restore intent and clean up errors

* Restore intent even better

* Restore intent even better x2

* Add missed baselines
This commit is contained in:
Nathan Shively-Sanders 2018-03-21 14:22:09 -07:00 committed by GitHub
parent ee546fb30f
commit de4a69cb72
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
69 changed files with 1336 additions and 994 deletions

View File

@ -487,7 +487,7 @@ namespace ts {
// Depending on what kind of node this is, we may have to adjust the current container
// and block-container. If the current node is a container, then it is automatically
// considered the current block-container as well. Also, for containers that we know
// may contain locals, we proactively initialize the .locals field. We do this because
// may contain locals, we eagerly initialize the .locals field. We do this because
// it's highly likely that the .locals will be needed to place some child in (for example,
// a parameter, or variable declaration).
//
@ -593,20 +593,25 @@ namespace ts {
}
}
function bindEach(nodes: NodeArray<Node>) {
function bindEachFunctionsFirst(nodes: NodeArray<Node>) {
bindEach(nodes, n => n.kind === SyntaxKind.FunctionDeclaration ? bind(n) : undefined);
bindEach(nodes, n => n.kind !== SyntaxKind.FunctionDeclaration ? bind(n) : undefined);
}
function bindEach(nodes: NodeArray<Node>, bindFunction = bind) {
if (nodes === undefined) {
return;
}
if (skipTransformFlagAggregation) {
forEach(nodes, bind);
forEach(nodes, bindFunction);
}
else {
const savedSubtreeTransformFlags = subtreeTransformFlags;
subtreeTransformFlags = TransformFlags.None;
let nodeArrayFlags = TransformFlags.None;
for (const node of nodes) {
bind(node);
bindFunction(node);
nodeArrayFlags |= node.transformFlags & ~TransformFlags.HasComputedFlags;
}
nodes.transformFlags = nodeArrayFlags | TransformFlags.HasComputedFlags;
@ -706,6 +711,15 @@ namespace ts {
case SyntaxKind.JSDocTypedefTag:
bindJSDocTypedefTag(<JSDocTypedefTag>node);
break;
// In source files and blocks, bind functions first to match hoisting that occurs at runtime
case SyntaxKind.SourceFile:
bindEachFunctionsFirst((node as SourceFile).statements);
bind((node as SourceFile).endOfFileToken);
break;
case SyntaxKind.Block:
case SyntaxKind.ModuleBlock:
bindEachFunctionsFirst((node as Block).statements);
break;
default:
bindEachChild(node);
break;

View File

@ -31,7 +31,7 @@ module B {
>B : Symbol(B, Decl(simple.ts, 0, 0))
export module Point {
>Point : Symbol(Point, Decl(simple.ts, 0, 10), Decl(simple.ts, 4, 5))
>Point : Symbol(Point, Decl(simple.ts, 4, 5), Decl(simple.ts, 0, 10))
export var Origin = { x: 0, y: 0 };
>Origin : Symbol(Origin, Decl(simple.ts, 3, 18))
@ -41,7 +41,7 @@ module B {
// duplicate identifier error
export function Point() {
>Point : Symbol(Point, Decl(simple.ts, 0, 10), Decl(simple.ts, 4, 5))
>Point : Symbol(Point, Decl(simple.ts, 4, 5), Decl(simple.ts, 0, 10))
return { x: 0, y: 0 };
>x : Symbol(x, Decl(simple.ts, 8, 16))

View File

@ -1,12 +1,12 @@
=== tests/cases/compiler/ambientFundule.ts ===
declare function f();
>f : Symbol(f, Decl(ambientFundule.ts, 0, 0), Decl(ambientFundule.ts, 0, 21), Decl(ambientFundule.ts, 1, 26))
>f : Symbol(f, Decl(ambientFundule.ts, 0, 0), Decl(ambientFundule.ts, 1, 26), Decl(ambientFundule.ts, 0, 21))
declare module f { var x }
>f : Symbol(f, Decl(ambientFundule.ts, 0, 0), Decl(ambientFundule.ts, 0, 21), Decl(ambientFundule.ts, 1, 26))
>f : Symbol(f, Decl(ambientFundule.ts, 0, 0), Decl(ambientFundule.ts, 1, 26), Decl(ambientFundule.ts, 0, 21))
>x : Symbol(x, Decl(ambientFundule.ts, 1, 22))
declare function f(x);
>f : Symbol(f, Decl(ambientFundule.ts, 0, 0), Decl(ambientFundule.ts, 0, 21), Decl(ambientFundule.ts, 1, 26))
>f : Symbol(f, Decl(ambientFundule.ts, 0, 0), Decl(ambientFundule.ts, 1, 26), Decl(ambientFundule.ts, 0, 21))
>x : Symbol(x, Decl(ambientFundule.ts, 2, 19))

View File

@ -42,24 +42,24 @@ var m1d = 1; // error
// module then function
module m2 { }
>m2 : Symbol(m2, Decl(augmentedTypesModules.ts, 18, 12), Decl(augmentedTypesModules.ts, 21, 13))
>m2 : Symbol(m2, Decl(augmentedTypesModules.ts, 21, 13), Decl(augmentedTypesModules.ts, 18, 12))
function m2() { }; // ok since the module is not instantiated
>m2 : Symbol(m2, Decl(augmentedTypesModules.ts, 18, 12), Decl(augmentedTypesModules.ts, 21, 13))
>m2 : Symbol(m2, Decl(augmentedTypesModules.ts, 21, 13), Decl(augmentedTypesModules.ts, 18, 12))
module m2a { var y = 2; }
>m2a : Symbol(m2a, Decl(augmentedTypesModules.ts, 22, 18), Decl(augmentedTypesModules.ts, 24, 25))
>m2a : Symbol(m2a, Decl(augmentedTypesModules.ts, 24, 25), Decl(augmentedTypesModules.ts, 22, 18))
>y : Symbol(y, Decl(augmentedTypesModules.ts, 24, 16))
function m2a() { }; // error since the module is instantiated
>m2a : Symbol(m2a, Decl(augmentedTypesModules.ts, 22, 18), Decl(augmentedTypesModules.ts, 24, 25))
>m2a : Symbol(m2a, Decl(augmentedTypesModules.ts, 24, 25), Decl(augmentedTypesModules.ts, 22, 18))
module m2b { export var y = 2; }
>m2b : Symbol(m2b, Decl(augmentedTypesModules.ts, 25, 19), Decl(augmentedTypesModules.ts, 27, 32))
>m2b : Symbol(m2b, Decl(augmentedTypesModules.ts, 27, 32), Decl(augmentedTypesModules.ts, 25, 19))
>y : Symbol(y, Decl(augmentedTypesModules.ts, 27, 23))
function m2b() { }; // error since the module is instantiated
>m2b : Symbol(m2b, Decl(augmentedTypesModules.ts, 25, 19), Decl(augmentedTypesModules.ts, 27, 32))
>m2b : Symbol(m2b, Decl(augmentedTypesModules.ts, 27, 32), Decl(augmentedTypesModules.ts, 25, 19))
// should be errors to have function first
function m2c() { };
@ -70,10 +70,10 @@ module m2c { export var y = 2; }
>y : Symbol(y, Decl(augmentedTypesModules.ts, 32, 23))
module m2d { }
>m2d : Symbol(m2d, Decl(augmentedTypesModules.ts, 32, 32), Decl(augmentedTypesModules.ts, 34, 14))
>m2d : Symbol(m2d, Decl(augmentedTypesModules.ts, 34, 14), Decl(augmentedTypesModules.ts, 32, 32))
declare function m2d(): void;
>m2d : Symbol(m2d, Decl(augmentedTypesModules.ts, 32, 32), Decl(augmentedTypesModules.ts, 34, 14))
>m2d : Symbol(m2d, Decl(augmentedTypesModules.ts, 34, 14), Decl(augmentedTypesModules.ts, 32, 32))
declare function m2e(): void;
>m2e : Symbol(m2e, Decl(augmentedTypesModules.ts, 35, 29), Decl(augmentedTypesModules.ts, 37, 29))

View File

@ -1,24 +1,24 @@
=== tests/cases/compiler/augmentedTypesModules2.ts ===
// module then function
module m2 { }
>m2 : Symbol(m2, Decl(augmentedTypesModules2.ts, 0, 0), Decl(augmentedTypesModules2.ts, 1, 13))
>m2 : Symbol(m2, Decl(augmentedTypesModules2.ts, 1, 13), Decl(augmentedTypesModules2.ts, 0, 0))
function m2() { }; // ok since the module is not instantiated
>m2 : Symbol(m2, Decl(augmentedTypesModules2.ts, 0, 0), Decl(augmentedTypesModules2.ts, 1, 13))
>m2 : Symbol(m2, Decl(augmentedTypesModules2.ts, 1, 13), Decl(augmentedTypesModules2.ts, 0, 0))
module m2a { var y = 2; }
>m2a : Symbol(m2a, Decl(augmentedTypesModules2.ts, 2, 18), Decl(augmentedTypesModules2.ts, 4, 25))
>m2a : Symbol(m2a, Decl(augmentedTypesModules2.ts, 4, 25), Decl(augmentedTypesModules2.ts, 2, 18))
>y : Symbol(y, Decl(augmentedTypesModules2.ts, 4, 16))
function m2a() { }; // error since the module is instantiated
>m2a : Symbol(m2a, Decl(augmentedTypesModules2.ts, 2, 18), Decl(augmentedTypesModules2.ts, 4, 25))
>m2a : Symbol(m2a, Decl(augmentedTypesModules2.ts, 4, 25), Decl(augmentedTypesModules2.ts, 2, 18))
module m2b { export var y = 2; }
>m2b : Symbol(m2b, Decl(augmentedTypesModules2.ts, 5, 19), Decl(augmentedTypesModules2.ts, 7, 32))
>m2b : Symbol(m2b, Decl(augmentedTypesModules2.ts, 7, 32), Decl(augmentedTypesModules2.ts, 5, 19))
>y : Symbol(y, Decl(augmentedTypesModules2.ts, 7, 23))
function m2b() { }; // error since the module is instantiated
>m2b : Symbol(m2b, Decl(augmentedTypesModules2.ts, 5, 19), Decl(augmentedTypesModules2.ts, 7, 32))
>m2b : Symbol(m2b, Decl(augmentedTypesModules2.ts, 7, 32), Decl(augmentedTypesModules2.ts, 5, 19))
function m2c() { };
>m2c : Symbol(m2c, Decl(augmentedTypesModules2.ts, 8, 19), Decl(augmentedTypesModules2.ts, 10, 19))
@ -28,17 +28,17 @@ module m2c { export var y = 2; }
>y : Symbol(y, Decl(augmentedTypesModules2.ts, 11, 23))
module m2cc { export var y = 2; }
>m2cc : Symbol(m2cc, Decl(augmentedTypesModules2.ts, 11, 32), Decl(augmentedTypesModules2.ts, 13, 33))
>m2cc : Symbol(m2cc, Decl(augmentedTypesModules2.ts, 13, 33), Decl(augmentedTypesModules2.ts, 11, 32))
>y : Symbol(y, Decl(augmentedTypesModules2.ts, 13, 24))
function m2cc() { }; // error to have module first
>m2cc : Symbol(m2cc, Decl(augmentedTypesModules2.ts, 11, 32), Decl(augmentedTypesModules2.ts, 13, 33))
>m2cc : Symbol(m2cc, Decl(augmentedTypesModules2.ts, 13, 33), Decl(augmentedTypesModules2.ts, 11, 32))
module m2d { }
>m2d : Symbol(m2d, Decl(augmentedTypesModules2.ts, 14, 20), Decl(augmentedTypesModules2.ts, 16, 14))
>m2d : Symbol(m2d, Decl(augmentedTypesModules2.ts, 16, 14), Decl(augmentedTypesModules2.ts, 14, 20))
declare function m2d(): void;
>m2d : Symbol(m2d, Decl(augmentedTypesModules2.ts, 14, 20), Decl(augmentedTypesModules2.ts, 16, 14))
>m2d : Symbol(m2d, Decl(augmentedTypesModules2.ts, 16, 14), Decl(augmentedTypesModules2.ts, 14, 20))
declare function m2e(): void;
>m2e : Symbol(m2e, Decl(augmentedTypesModules2.ts, 17, 29), Decl(augmentedTypesModules2.ts, 19, 29))

View File

@ -1,10 +1,11 @@
tests/cases/compiler/callOverloads1.ts(1,7): error TS2300: Duplicate identifier 'Foo'.
tests/cases/compiler/callOverloads1.ts(9,10): error TS2300: Duplicate identifier 'Foo'.
tests/cases/compiler/callOverloads1.ts(9,10): error TS2391: Function implementation is missing or not immediately following the declaration.
tests/cases/compiler/callOverloads1.ts(17,1): error TS2348: Value of type 'typeof Foo' is not callable. Did you mean to include 'new'?
tests/cases/compiler/callOverloads1.ts(13,10): error TS2350: Only a void function can be called with the 'new' keyword.
tests/cases/compiler/callOverloads1.ts(13,10): error TS2554: Expected 0 arguments, but got 1.
==== tests/cases/compiler/callOverloads1.ts (4 errors) ====
==== tests/cases/compiler/callOverloads1.ts (5 errors) ====
class Foo { // error
~~~
!!! error TS2300: Duplicate identifier 'Foo'.
@ -24,9 +25,11 @@ tests/cases/compiler/callOverloads1.ts(17,1): error TS2348: Value of type 'typeo
function F1(a:any) { return a;}
var f1 = new Foo("hey");
~~~~~~~~~~~~~~
!!! error TS2350: Only a void function can be called with the 'new' keyword.
~~~~~~~~~~~~~~
!!! error TS2554: Expected 0 arguments, but got 1.
f1.bar1();
Foo();
~~~~~
!!! error TS2348: Value of type 'typeof Foo' is not callable. Did you mean to include 'new'?
Foo();

View File

@ -26,14 +26,12 @@ function F1(a:any) { return a;}
var f1 = new Foo("hey");
>f1 : Symbol(f1, Decl(callOverloads1.ts, 12, 3))
>Foo : Symbol(Foo, Decl(callOverloads1.ts, 0, 0))
>Foo : Symbol(Foo, Decl(callOverloads1.ts, 6, 1))
f1.bar1();
>f1.bar1 : Symbol(Foo.bar1, Decl(callOverloads1.ts, 0, 11))
>f1 : Symbol(f1, Decl(callOverloads1.ts, 12, 3))
>bar1 : Symbol(Foo.bar1, Decl(callOverloads1.ts, 0, 11))
Foo();
>Foo : Symbol(Foo, Decl(callOverloads1.ts, 0, 0))
>Foo : Symbol(Foo, Decl(callOverloads1.ts, 6, 1))

View File

@ -25,19 +25,19 @@ function F1(a:any) { return a;}
>a : any
var f1 = new Foo("hey");
>f1 : Foo
>new Foo("hey") : Foo
>Foo : typeof Foo
>f1 : any
>new Foo("hey") : any
>Foo : () => any
>"hey" : "hey"
f1.bar1();
>f1.bar1() : void
>f1.bar1 : () => void
>f1 : Foo
>bar1 : () => void
>f1.bar1() : any
>f1.bar1 : any
>f1 : any
>bar1 : any
Foo();
>Foo() : any
>Foo : typeof Foo
>Foo : () => any

View File

@ -4,10 +4,11 @@ tests/cases/compiler/callOverloads2.ts(11,10): error TS2389: Function implementa
tests/cases/compiler/callOverloads2.ts(11,10): error TS2393: Duplicate function implementation.
tests/cases/compiler/callOverloads2.ts(12,10): error TS2393: Duplicate function implementation.
tests/cases/compiler/callOverloads2.ts(14,10): error TS2391: Function implementation is missing or not immediately following the declaration.
tests/cases/compiler/callOverloads2.ts(22,1): error TS2348: Value of type 'typeof Foo' is not callable. Did you mean to include 'new'?
tests/cases/compiler/callOverloads2.ts(18,10): error TS2350: Only a void function can be called with the 'new' keyword.
tests/cases/compiler/callOverloads2.ts(18,10): error TS2554: Expected 0 arguments, but got 1.
==== tests/cases/compiler/callOverloads2.ts (7 errors) ====
==== tests/cases/compiler/callOverloads2.ts (8 errors) ====
class Foo { // error
~~~
!!! error TS2300: Duplicate identifier 'Foo'.
@ -38,10 +39,12 @@ tests/cases/compiler/callOverloads2.ts(22,1): error TS2348: Value of type 'typeo
declare function Gar(s:String); // expect no error
var f1 = new Foo("hey");
~~~~~~~~~~~~~~
!!! error TS2350: Only a void function can be called with the 'new' keyword.
~~~~~~~~~~~~~~
!!! error TS2554: Expected 0 arguments, but got 1.
f1.bar1();
Foo();
~~~~~
!!! error TS2348: Value of type 'typeof Foo' is not callable. Did you mean to include 'new'?

View File

@ -36,14 +36,12 @@ declare function Gar(s:String); // expect no error
var f1 = new Foo("hey");
>f1 : Symbol(f1, Decl(callOverloads2.ts, 17, 3))
>Foo : Symbol(Foo, Decl(callOverloads2.ts, 0, 0))
>Foo : Symbol(Foo, Decl(callOverloads2.ts, 6, 1))
f1.bar1();
>f1.bar1 : Symbol(Foo.bar1, Decl(callOverloads2.ts, 0, 11))
>f1 : Symbol(f1, Decl(callOverloads2.ts, 17, 3))
>bar1 : Symbol(Foo.bar1, Decl(callOverloads2.ts, 0, 11))
Foo();
>Foo : Symbol(Foo, Decl(callOverloads2.ts, 0, 0))
>Foo : Symbol(Foo, Decl(callOverloads2.ts, 6, 1))

View File

@ -35,19 +35,19 @@ declare function Gar(s:String); // expect no error
>String : String
var f1 = new Foo("hey");
>f1 : Foo
>new Foo("hey") : Foo
>Foo : typeof Foo
>f1 : any
>new Foo("hey") : any
>Foo : () => any
>"hey" : "hey"
f1.bar1();
>f1.bar1() : void
>f1.bar1 : () => void
>f1 : Foo
>bar1 : () => void
>f1.bar1() : any
>f1.bar1 : any
>f1 : any
>bar1 : any
Foo();
>Foo() : any
>Foo : typeof Foo
>Foo : () => any

File diff suppressed because it is too large Load Diff

View File

@ -1,21 +1,27 @@
tests/cases/compiler/conflictingTypeAnnotatedVar.ts(1,5): error TS2300: Duplicate identifier 'foo'.
tests/cases/compiler/conflictingTypeAnnotatedVar.ts(2,10): error TS2300: Duplicate identifier 'foo'.
tests/cases/compiler/conflictingTypeAnnotatedVar.ts(2,10): error TS2393: Duplicate function implementation.
tests/cases/compiler/conflictingTypeAnnotatedVar.ts(2,17): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value.
tests/cases/compiler/conflictingTypeAnnotatedVar.ts(3,10): error TS2300: Duplicate identifier 'foo'.
tests/cases/compiler/conflictingTypeAnnotatedVar.ts(3,10): error TS2393: Duplicate function implementation.
tests/cases/compiler/conflictingTypeAnnotatedVar.ts(3,17): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value.
==== tests/cases/compiler/conflictingTypeAnnotatedVar.ts (5 errors) ====
==== tests/cases/compiler/conflictingTypeAnnotatedVar.ts (7 errors) ====
var foo: string;
~~~
!!! error TS2300: Duplicate identifier 'foo'.
function foo(): number { }
~~~
!!! error TS2300: Duplicate identifier 'foo'.
~~~
!!! error TS2393: Duplicate function implementation.
~~~~~~
!!! error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value.
function foo(): number { }
~~~
!!! error TS2300: Duplicate identifier 'foo'.
~~~
!!! error TS2393: Duplicate function implementation.
~~~~~~
!!! error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value.

View File

@ -3,8 +3,8 @@ var foo: string;
>foo : Symbol(foo, Decl(conflictingTypeAnnotatedVar.ts, 0, 3))
function foo(): number { }
>foo : Symbol(foo, Decl(conflictingTypeAnnotatedVar.ts, 0, 16))
>foo : Symbol(foo, Decl(conflictingTypeAnnotatedVar.ts, 0, 16), Decl(conflictingTypeAnnotatedVar.ts, 1, 26))
function foo(): number { }
>foo : Symbol(foo, Decl(conflictingTypeAnnotatedVar.ts, 1, 26))
>foo : Symbol(foo, Decl(conflictingTypeAnnotatedVar.ts, 0, 16), Decl(conflictingTypeAnnotatedVar.ts, 1, 26))

View File

@ -1,11 +1,10 @@
tests/cases/compiler/constructorOverloads4.ts(2,18): error TS2300: Duplicate identifier 'Function'.
tests/cases/compiler/constructorOverloads4.ts(5,21): error TS2300: Duplicate identifier 'Function'.
tests/cases/compiler/constructorOverloads4.ts(6,21): error TS2300: Duplicate identifier 'Function'.
tests/cases/compiler/constructorOverloads4.ts(10,1): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'Function' has no compatible call signatures.
tests/cases/compiler/constructorOverloads4.ts(11,1): error TS2348: Value of type 'typeof Function' is not callable. Did you mean to include 'new'?
tests/cases/compiler/constructorOverloads4.ts(10,2): error TS2350: Only a void function can be called with the 'new' keyword.
==== tests/cases/compiler/constructorOverloads4.ts (5 errors) ====
==== tests/cases/compiler/constructorOverloads4.ts (4 errors) ====
declare module M {
export class Function {
~~~~~~~~
@ -22,9 +21,7 @@ tests/cases/compiler/constructorOverloads4.ts(11,1): error TS2348: Value of type
(new M.Function("return 5"))();
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'Function' has no compatible call signatures.
~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2350: Only a void function can be called with the 'new' keyword.
M.Function("yo");
~~~~~~~~~~~~~~~~
!!! error TS2348: Value of type 'typeof Function' is not callable. Did you mean to include 'new'?

View File

@ -3,29 +3,29 @@ declare module M {
>M : Symbol(M, Decl(constructorOverloads4.ts, 0, 0))
export class Function {
>Function : Symbol(Function, Decl(constructorOverloads4.ts, 0, 18))
>Function : Symbol(M.Function, Decl(constructorOverloads4.ts, 0, 18))
constructor(...args: string[]);
>args : Symbol(args, Decl(constructorOverloads4.ts, 2, 20))
}
export function Function(...args: any[]): any;
>Function : Symbol(M.Function, Decl(constructorOverloads4.ts, 3, 5))
>Function : Symbol(Function, Decl(constructorOverloads4.ts, 3, 5), Decl(constructorOverloads4.ts, 4, 50))
>args : Symbol(args, Decl(constructorOverloads4.ts, 4, 29))
export function Function(...args: string[]): Function;
>Function : Symbol(M.Function, Decl(constructorOverloads4.ts, 4, 50))
>Function : Symbol(Function, Decl(constructorOverloads4.ts, 3, 5), Decl(constructorOverloads4.ts, 4, 50))
>args : Symbol(args, Decl(constructorOverloads4.ts, 5, 29))
>Function : Symbol(Function, Decl(constructorOverloads4.ts, 0, 18))
>Function : Symbol(Function, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
}
(new M.Function("return 5"))();
>M.Function : Symbol(M.Function, Decl(constructorOverloads4.ts, 0, 18))
>M.Function : Symbol(M.Function, Decl(constructorOverloads4.ts, 3, 5), Decl(constructorOverloads4.ts, 4, 50))
>M : Symbol(M, Decl(constructorOverloads4.ts, 0, 0))
>Function : Symbol(M.Function, Decl(constructorOverloads4.ts, 0, 18))
>Function : Symbol(M.Function, Decl(constructorOverloads4.ts, 3, 5), Decl(constructorOverloads4.ts, 4, 50))
M.Function("yo");
>M.Function : Symbol(M.Function, Decl(constructorOverloads4.ts, 0, 18))
>M.Function : Symbol(M.Function, Decl(constructorOverloads4.ts, 3, 5), Decl(constructorOverloads4.ts, 4, 50))
>M : Symbol(M, Decl(constructorOverloads4.ts, 0, 0))
>Function : Symbol(M.Function, Decl(constructorOverloads4.ts, 0, 18))
>Function : Symbol(M.Function, Decl(constructorOverloads4.ts, 3, 5), Decl(constructorOverloads4.ts, 4, 50))

View File

@ -3,17 +3,17 @@ declare module M {
>M : typeof M
export class Function {
>Function : Function
>Function : M.Function
constructor(...args: string[]);
>args : string[]
}
export function Function(...args: any[]): any;
>Function : (...args: any[]) => any
>Function : { (...args: any[]): any; (...args: string[]): Function; }
>args : any[]
export function Function(...args: string[]): Function;
>Function : (...args: string[]) => Function
>Function : { (...args: any[]): any; (...args: string[]): Function; }
>args : string[]
>Function : Function
}
@ -21,17 +21,17 @@ declare module M {
(new M.Function("return 5"))();
>(new M.Function("return 5"))() : any
>(new M.Function("return 5")) : M.Function
>new M.Function("return 5") : M.Function
>M.Function : typeof M.Function
>(new M.Function("return 5")) : any
>new M.Function("return 5") : any
>M.Function : { (...args: any[]): any; (...args: string[]): Function; }
>M : typeof M
>Function : typeof M.Function
>Function : { (...args: any[]): any; (...args: string[]): Function; }
>"return 5" : "return 5"
M.Function("yo");
>M.Function("yo") : any
>M.Function : typeof M.Function
>M.Function : { (...args: any[]): any; (...args: string[]): Function; }
>M : typeof M
>Function : typeof M.Function
>Function : { (...args: any[]): any; (...args: string[]): Function; }
>"yo" : "yo"

View File

@ -1,9 +1,11 @@
tests/cases/compiler/constructorOverloads7.ts(1,15): error TS2300: Duplicate identifier 'Point'.
tests/cases/compiler/constructorOverloads7.ts(7,35): error TS2304: Cannot find name 'Point'.
tests/cases/compiler/constructorOverloads7.ts(8,14): error TS2304: Cannot find name 'Point'.
tests/cases/compiler/constructorOverloads7.ts(15,10): error TS2300: Duplicate identifier 'Point'.
tests/cases/compiler/constructorOverloads7.ts(22,18): error TS2384: Overload signatures must all be ambient or non-ambient.
==== tests/cases/compiler/constructorOverloads7.ts (3 errors) ====
==== tests/cases/compiler/constructorOverloads7.ts (5 errors) ====
declare class Point
~~~~~
!!! error TS2300: Duplicate identifier 'Point'.
@ -13,7 +15,11 @@ tests/cases/compiler/constructorOverloads7.ts(22,18): error TS2384: Overload sig
constructor(x: number, y: number);
add(dx: number, dy: number): Point;
~~~~~
!!! error TS2304: Cannot find name 'Point'.
origin: Point;
~~~~~
!!! error TS2304: Cannot find name 'Point'.
}

View File

@ -16,11 +16,9 @@ declare class Point
>add : Symbol(Point.add, Decl(constructorOverloads7.ts, 4, 38))
>dx : Symbol(dx, Decl(constructorOverloads7.ts, 6, 9))
>dy : Symbol(dy, Decl(constructorOverloads7.ts, 6, 20))
>Point : Symbol(Point, Decl(constructorOverloads7.ts, 0, 0))
origin: Point;
>origin : Symbol(Point.origin, Decl(constructorOverloads7.ts, 6, 40))
>Point : Symbol(Point, Decl(constructorOverloads7.ts, 0, 0))
}

View File

@ -13,14 +13,14 @@ declare class Point
>y : number
add(dx: number, dy: number): Point;
>add : (dx: number, dy: number) => Point
>add : (dx: number, dy: number) => any
>dx : number
>dy : number
>Point : Point
>Point : No type information available!
origin: Point;
>origin : Point
>Point : Point
>origin : any
>Point : No type information available!
}

View File

@ -1,11 +1,9 @@
tests/cases/compiler/contextualTyping.ts(189,18): error TS2384: Overload signatures must all be ambient or non-ambient.
tests/cases/compiler/contextualTyping.ts(197,15): error TS2300: Duplicate identifier 'Point'.
tests/cases/compiler/contextualTyping.ts(207,10): error TS2300: Duplicate identifier 'Point'.
tests/cases/compiler/contextualTyping.ts(230,5): error TS2322: Type '{}' is not assignable to type 'B'.
tests/cases/compiler/contextualTyping.ts(223,5): error TS2322: Type '{}' is not assignable to type 'B'.
Property 'x' is missing in type '{}'.
==== tests/cases/compiler/contextualTyping.ts (4 errors) ====
==== tests/cases/compiler/contextualTyping.ts (2 errors) ====
// DEFAULT INTERFACES
interface IFoo {
n: number;
@ -205,8 +203,6 @@ tests/cases/compiler/contextualTyping.ts(230,5): error TS2322: Type '{}' is not
// contextually typing from ambient class declarations
declare class Point
~~~~~
!!! error TS2300: Duplicate identifier 'Point'.
{
constructor(x: number, y: number);
x: number;
@ -216,15 +212,6 @@ tests/cases/compiler/contextualTyping.ts(230,5): error TS2322: Type '{}' is not
}
function Point(x, y) {
~~~~~
!!! error TS2300: Duplicate identifier 'Point'.
this.x = x;
this.y = y;
return this;
}
Point.origin = new Point(0, 0);
Point.prototype.add = function(dx, dy) {

View File

@ -205,13 +205,6 @@ declare class Point
}
function Point(x, y) {
this.x = x;
this.y = y;
return this;
}
Point.origin = new Point(0, 0);
Point.prototype.add = function(dx, dy) {
@ -357,11 +350,6 @@ var c12t14 = ({
});
function EF1(a, b) { return a + b; }
var efv = EF1(1, 2);
function Point(x, y) {
this.x = x;
this.y = y;
return this;
}
Point.origin = new Point(0, 0);
Point.prototype.add = function (dx, dy) {
return new Point(this.x + dx, this.y + dy);

File diff suppressed because one or more lines are too long

View File

@ -3077,7 +3077,7 @@ sourceFile:contextualTyping.ts
9 > ^
10> ^
11> ^
12> ^^^->
12> ^^^^^^^^^^^^->
1 >
>
>
@ -3103,113 +3103,6 @@ sourceFile:contextualTyping.ts
10>Emitted(125, 20) Source(193, 19) + SourceIndex(0)
11>Emitted(125, 21) Source(193, 20) + SourceIndex(0)
---
>>>function Point(x, y) {
1->
2 >^^^^^^^^^^^^^^^
3 > ^
4 > ^^
5 > ^
1->
>
>
>// contextually typing from ambient class declarations
>declare class Point
>{
> constructor(x: number, y: number);
> x: number;
> y: number;
> add(dx: number, dy: number): Point;
> static origin: Point;
>
>}
>
>
2 >function Point(
3 > x
4 > ,
5 > y
1->Emitted(126, 1) Source(207, 1) + SourceIndex(0)
2 >Emitted(126, 16) Source(207, 16) + SourceIndex(0)
3 >Emitted(126, 17) Source(207, 17) + SourceIndex(0)
4 >Emitted(126, 19) Source(207, 19) + SourceIndex(0)
5 >Emitted(126, 20) Source(207, 20) + SourceIndex(0)
---
>>> this.x = x;
1 >^^^^
2 > ^^^^
3 > ^
4 > ^
5 > ^^^
6 > ^
7 > ^
8 > ^->
1 >) {
>
2 > this
3 > .
4 > x
5 > =
6 > x
7 > ;
1 >Emitted(127, 5) Source(208, 5) + SourceIndex(0)
2 >Emitted(127, 9) Source(208, 9) + SourceIndex(0)
3 >Emitted(127, 10) Source(208, 10) + SourceIndex(0)
4 >Emitted(127, 11) Source(208, 11) + SourceIndex(0)
5 >Emitted(127, 14) Source(208, 14) + SourceIndex(0)
6 >Emitted(127, 15) Source(208, 15) + SourceIndex(0)
7 >Emitted(127, 16) Source(208, 16) + SourceIndex(0)
---
>>> this.y = y;
1->^^^^
2 > ^^^^
3 > ^
4 > ^
5 > ^^^
6 > ^
7 > ^
8 > ^^->
1->
>
2 > this
3 > .
4 > y
5 > =
6 > y
7 > ;
1->Emitted(128, 5) Source(209, 5) + SourceIndex(0)
2 >Emitted(128, 9) Source(209, 9) + SourceIndex(0)
3 >Emitted(128, 10) Source(209, 10) + SourceIndex(0)
4 >Emitted(128, 11) Source(209, 11) + SourceIndex(0)
5 >Emitted(128, 14) Source(209, 14) + SourceIndex(0)
6 >Emitted(128, 15) Source(209, 15) + SourceIndex(0)
7 >Emitted(128, 16) Source(209, 16) + SourceIndex(0)
---
>>> return this;
1->^^^^
2 > ^^^^^^^
3 > ^^^^
4 > ^
1->
>
>
2 > return
3 > this
4 > ;
1->Emitted(129, 5) Source(211, 5) + SourceIndex(0)
2 >Emitted(129, 12) Source(211, 12) + SourceIndex(0)
3 >Emitted(129, 16) Source(211, 16) + SourceIndex(0)
4 >Emitted(129, 17) Source(211, 17) + SourceIndex(0)
---
>>>}
1 >
2 >^
3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
1 >
>
2 >}
1 >Emitted(130, 1) Source(212, 1) + SourceIndex(0)
2 >Emitted(130, 2) Source(212, 2) + SourceIndex(0)
---
>>>Point.origin = new Point(0, 0);
1->
2 >^^^^^
@ -3226,6 +3119,18 @@ sourceFile:contextualTyping.ts
13> ^
14> ^^^^^^^^^^^->
1->
>
>
>// contextually typing from ambient class declarations
>declare class Point
>{
> constructor(x: number, y: number);
> x: number;
> y: number;
> add(dx: number, dy: number): Point;
> static origin: Point;
>
>}
>
>
2 >Point
@ -3240,19 +3145,19 @@ sourceFile:contextualTyping.ts
11> 0
12> )
13> ;
1->Emitted(131, 1) Source(214, 1) + SourceIndex(0)
2 >Emitted(131, 6) Source(214, 6) + SourceIndex(0)
3 >Emitted(131, 7) Source(214, 7) + SourceIndex(0)
4 >Emitted(131, 13) Source(214, 13) + SourceIndex(0)
5 >Emitted(131, 16) Source(214, 16) + SourceIndex(0)
6 >Emitted(131, 20) Source(214, 20) + SourceIndex(0)
7 >Emitted(131, 25) Source(214, 25) + SourceIndex(0)
8 >Emitted(131, 26) Source(214, 26) + SourceIndex(0)
9 >Emitted(131, 27) Source(214, 27) + SourceIndex(0)
10>Emitted(131, 29) Source(214, 29) + SourceIndex(0)
11>Emitted(131, 30) Source(214, 30) + SourceIndex(0)
12>Emitted(131, 31) Source(214, 31) + SourceIndex(0)
13>Emitted(131, 32) Source(214, 32) + SourceIndex(0)
1->Emitted(126, 1) Source(207, 1) + SourceIndex(0)
2 >Emitted(126, 6) Source(207, 6) + SourceIndex(0)
3 >Emitted(126, 7) Source(207, 7) + SourceIndex(0)
4 >Emitted(126, 13) Source(207, 13) + SourceIndex(0)
5 >Emitted(126, 16) Source(207, 16) + SourceIndex(0)
6 >Emitted(126, 20) Source(207, 20) + SourceIndex(0)
7 >Emitted(126, 25) Source(207, 25) + SourceIndex(0)
8 >Emitted(126, 26) Source(207, 26) + SourceIndex(0)
9 >Emitted(126, 27) Source(207, 27) + SourceIndex(0)
10>Emitted(126, 29) Source(207, 29) + SourceIndex(0)
11>Emitted(126, 30) Source(207, 30) + SourceIndex(0)
12>Emitted(126, 31) Source(207, 31) + SourceIndex(0)
13>Emitted(126, 32) Source(207, 32) + SourceIndex(0)
---
>>>Point.prototype.add = function (dx, dy) {
1->
@ -3280,17 +3185,17 @@ sourceFile:contextualTyping.ts
9 > dx
10> ,
11> dy
1->Emitted(132, 1) Source(216, 1) + SourceIndex(0)
2 >Emitted(132, 6) Source(216, 6) + SourceIndex(0)
3 >Emitted(132, 7) Source(216, 7) + SourceIndex(0)
4 >Emitted(132, 16) Source(216, 16) + SourceIndex(0)
5 >Emitted(132, 17) Source(216, 17) + SourceIndex(0)
6 >Emitted(132, 20) Source(216, 20) + SourceIndex(0)
7 >Emitted(132, 23) Source(216, 23) + SourceIndex(0)
8 >Emitted(132, 33) Source(216, 32) + SourceIndex(0)
9 >Emitted(132, 35) Source(216, 34) + SourceIndex(0)
10>Emitted(132, 37) Source(216, 36) + SourceIndex(0)
11>Emitted(132, 39) Source(216, 38) + SourceIndex(0)
1->Emitted(127, 1) Source(209, 1) + SourceIndex(0)
2 >Emitted(127, 6) Source(209, 6) + SourceIndex(0)
3 >Emitted(127, 7) Source(209, 7) + SourceIndex(0)
4 >Emitted(127, 16) Source(209, 16) + SourceIndex(0)
5 >Emitted(127, 17) Source(209, 17) + SourceIndex(0)
6 >Emitted(127, 20) Source(209, 20) + SourceIndex(0)
7 >Emitted(127, 23) Source(209, 23) + SourceIndex(0)
8 >Emitted(127, 33) Source(209, 32) + SourceIndex(0)
9 >Emitted(127, 35) Source(209, 34) + SourceIndex(0)
10>Emitted(127, 37) Source(209, 36) + SourceIndex(0)
11>Emitted(127, 39) Source(209, 38) + SourceIndex(0)
---
>>> return new Point(this.x + dx, this.y + dy);
1->^^^^
@ -3330,24 +3235,24 @@ sourceFile:contextualTyping.ts
16> dy
17> )
18> ;
1->Emitted(133, 5) Source(217, 5) + SourceIndex(0)
2 >Emitted(133, 12) Source(217, 12) + SourceIndex(0)
3 >Emitted(133, 16) Source(217, 16) + SourceIndex(0)
4 >Emitted(133, 21) Source(217, 21) + SourceIndex(0)
5 >Emitted(133, 22) Source(217, 22) + SourceIndex(0)
6 >Emitted(133, 26) Source(217, 26) + SourceIndex(0)
7 >Emitted(133, 27) Source(217, 27) + SourceIndex(0)
8 >Emitted(133, 28) Source(217, 28) + SourceIndex(0)
9 >Emitted(133, 31) Source(217, 31) + SourceIndex(0)
10>Emitted(133, 33) Source(217, 33) + SourceIndex(0)
11>Emitted(133, 35) Source(217, 35) + SourceIndex(0)
12>Emitted(133, 39) Source(217, 39) + SourceIndex(0)
13>Emitted(133, 40) Source(217, 40) + SourceIndex(0)
14>Emitted(133, 41) Source(217, 41) + SourceIndex(0)
15>Emitted(133, 44) Source(217, 44) + SourceIndex(0)
16>Emitted(133, 46) Source(217, 46) + SourceIndex(0)
17>Emitted(133, 47) Source(217, 47) + SourceIndex(0)
18>Emitted(133, 48) Source(217, 48) + SourceIndex(0)
1->Emitted(128, 5) Source(210, 5) + SourceIndex(0)
2 >Emitted(128, 12) Source(210, 12) + SourceIndex(0)
3 >Emitted(128, 16) Source(210, 16) + SourceIndex(0)
4 >Emitted(128, 21) Source(210, 21) + SourceIndex(0)
5 >Emitted(128, 22) Source(210, 22) + SourceIndex(0)
6 >Emitted(128, 26) Source(210, 26) + SourceIndex(0)
7 >Emitted(128, 27) Source(210, 27) + SourceIndex(0)
8 >Emitted(128, 28) Source(210, 28) + SourceIndex(0)
9 >Emitted(128, 31) Source(210, 31) + SourceIndex(0)
10>Emitted(128, 33) Source(210, 33) + SourceIndex(0)
11>Emitted(128, 35) Source(210, 35) + SourceIndex(0)
12>Emitted(128, 39) Source(210, 39) + SourceIndex(0)
13>Emitted(128, 40) Source(210, 40) + SourceIndex(0)
14>Emitted(128, 41) Source(210, 41) + SourceIndex(0)
15>Emitted(128, 44) Source(210, 44) + SourceIndex(0)
16>Emitted(128, 46) Source(210, 46) + SourceIndex(0)
17>Emitted(128, 47) Source(210, 47) + SourceIndex(0)
18>Emitted(128, 48) Source(210, 48) + SourceIndex(0)
---
>>>};
1 >
@ -3358,9 +3263,9 @@ sourceFile:contextualTyping.ts
>
2 >}
3 > ;
1 >Emitted(134, 1) Source(218, 1) + SourceIndex(0)
2 >Emitted(134, 2) Source(218, 2) + SourceIndex(0)
3 >Emitted(134, 3) Source(218, 3) + SourceIndex(0)
1 >Emitted(129, 1) Source(211, 1) + SourceIndex(0)
2 >Emitted(129, 2) Source(211, 2) + SourceIndex(0)
3 >Emitted(129, 3) Source(211, 3) + SourceIndex(0)
---
>>>Point.prototype = {
1->
@ -3375,11 +3280,11 @@ sourceFile:contextualTyping.ts
3 > .
4 > prototype
5 > =
1->Emitted(135, 1) Source(220, 1) + SourceIndex(0)
2 >Emitted(135, 6) Source(220, 6) + SourceIndex(0)
3 >Emitted(135, 7) Source(220, 7) + SourceIndex(0)
4 >Emitted(135, 16) Source(220, 16) + SourceIndex(0)
5 >Emitted(135, 19) Source(220, 19) + SourceIndex(0)
1->Emitted(130, 1) Source(213, 1) + SourceIndex(0)
2 >Emitted(130, 6) Source(213, 6) + SourceIndex(0)
3 >Emitted(130, 7) Source(213, 7) + SourceIndex(0)
4 >Emitted(130, 16) Source(213, 16) + SourceIndex(0)
5 >Emitted(130, 19) Source(213, 19) + SourceIndex(0)
---
>>> x: 0,
1 >^^^^
@ -3392,10 +3297,10 @@ sourceFile:contextualTyping.ts
2 > x
3 > :
4 > 0
1 >Emitted(136, 5) Source(221, 5) + SourceIndex(0)
2 >Emitted(136, 6) Source(221, 6) + SourceIndex(0)
3 >Emitted(136, 8) Source(221, 8) + SourceIndex(0)
4 >Emitted(136, 9) Source(221, 9) + SourceIndex(0)
1 >Emitted(131, 5) Source(214, 5) + SourceIndex(0)
2 >Emitted(131, 6) Source(214, 6) + SourceIndex(0)
3 >Emitted(131, 8) Source(214, 8) + SourceIndex(0)
4 >Emitted(131, 9) Source(214, 9) + SourceIndex(0)
---
>>> y: 0,
1->^^^^
@ -3408,10 +3313,10 @@ sourceFile:contextualTyping.ts
2 > y
3 > :
4 > 0
1->Emitted(137, 5) Source(222, 5) + SourceIndex(0)
2 >Emitted(137, 6) Source(222, 6) + SourceIndex(0)
3 >Emitted(137, 8) Source(222, 8) + SourceIndex(0)
4 >Emitted(137, 9) Source(222, 9) + SourceIndex(0)
1->Emitted(132, 5) Source(215, 5) + SourceIndex(0)
2 >Emitted(132, 6) Source(215, 6) + SourceIndex(0)
3 >Emitted(132, 8) Source(215, 8) + SourceIndex(0)
4 >Emitted(132, 9) Source(215, 9) + SourceIndex(0)
---
>>> add: function (dx, dy) {
1->^^^^
@ -3430,13 +3335,13 @@ sourceFile:contextualTyping.ts
5 > dx
6 > ,
7 > dy
1->Emitted(138, 5) Source(223, 5) + SourceIndex(0)
2 >Emitted(138, 8) Source(223, 8) + SourceIndex(0)
3 >Emitted(138, 10) Source(223, 10) + SourceIndex(0)
4 >Emitted(138, 20) Source(223, 19) + SourceIndex(0)
5 >Emitted(138, 22) Source(223, 21) + SourceIndex(0)
6 >Emitted(138, 24) Source(223, 23) + SourceIndex(0)
7 >Emitted(138, 26) Source(223, 25) + SourceIndex(0)
1->Emitted(133, 5) Source(216, 5) + SourceIndex(0)
2 >Emitted(133, 8) Source(216, 8) + SourceIndex(0)
3 >Emitted(133, 10) Source(216, 10) + SourceIndex(0)
4 >Emitted(133, 20) Source(216, 19) + SourceIndex(0)
5 >Emitted(133, 22) Source(216, 21) + SourceIndex(0)
6 >Emitted(133, 24) Source(216, 23) + SourceIndex(0)
7 >Emitted(133, 26) Source(216, 25) + SourceIndex(0)
---
>>> return new Point(this.x + dx, this.y + dy);
1->^^^^^^^^
@ -3476,24 +3381,24 @@ sourceFile:contextualTyping.ts
16> dy
17> )
18> ;
1->Emitted(139, 9) Source(224, 9) + SourceIndex(0)
2 >Emitted(139, 16) Source(224, 16) + SourceIndex(0)
3 >Emitted(139, 20) Source(224, 20) + SourceIndex(0)
4 >Emitted(139, 25) Source(224, 25) + SourceIndex(0)
5 >Emitted(139, 26) Source(224, 26) + SourceIndex(0)
6 >Emitted(139, 30) Source(224, 30) + SourceIndex(0)
7 >Emitted(139, 31) Source(224, 31) + SourceIndex(0)
8 >Emitted(139, 32) Source(224, 32) + SourceIndex(0)
9 >Emitted(139, 35) Source(224, 35) + SourceIndex(0)
10>Emitted(139, 37) Source(224, 37) + SourceIndex(0)
11>Emitted(139, 39) Source(224, 39) + SourceIndex(0)
12>Emitted(139, 43) Source(224, 43) + SourceIndex(0)
13>Emitted(139, 44) Source(224, 44) + SourceIndex(0)
14>Emitted(139, 45) Source(224, 45) + SourceIndex(0)
15>Emitted(139, 48) Source(224, 48) + SourceIndex(0)
16>Emitted(139, 50) Source(224, 50) + SourceIndex(0)
17>Emitted(139, 51) Source(224, 51) + SourceIndex(0)
18>Emitted(139, 52) Source(224, 52) + SourceIndex(0)
1->Emitted(134, 9) Source(217, 9) + SourceIndex(0)
2 >Emitted(134, 16) Source(217, 16) + SourceIndex(0)
3 >Emitted(134, 20) Source(217, 20) + SourceIndex(0)
4 >Emitted(134, 25) Source(217, 25) + SourceIndex(0)
5 >Emitted(134, 26) Source(217, 26) + SourceIndex(0)
6 >Emitted(134, 30) Source(217, 30) + SourceIndex(0)
7 >Emitted(134, 31) Source(217, 31) + SourceIndex(0)
8 >Emitted(134, 32) Source(217, 32) + SourceIndex(0)
9 >Emitted(134, 35) Source(217, 35) + SourceIndex(0)
10>Emitted(134, 37) Source(217, 37) + SourceIndex(0)
11>Emitted(134, 39) Source(217, 39) + SourceIndex(0)
12>Emitted(134, 43) Source(217, 43) + SourceIndex(0)
13>Emitted(134, 44) Source(217, 44) + SourceIndex(0)
14>Emitted(134, 45) Source(217, 45) + SourceIndex(0)
15>Emitted(134, 48) Source(217, 48) + SourceIndex(0)
16>Emitted(134, 50) Source(217, 50) + SourceIndex(0)
17>Emitted(134, 51) Source(217, 51) + SourceIndex(0)
18>Emitted(134, 52) Source(217, 52) + SourceIndex(0)
---
>>> }
1 >^^^^
@ -3501,8 +3406,8 @@ sourceFile:contextualTyping.ts
1 >
>
2 > }
1 >Emitted(140, 5) Source(225, 5) + SourceIndex(0)
2 >Emitted(140, 6) Source(225, 6) + SourceIndex(0)
1 >Emitted(135, 5) Source(218, 5) + SourceIndex(0)
2 >Emitted(135, 6) Source(218, 6) + SourceIndex(0)
---
>>>};
1 >^
@ -3511,8 +3416,8 @@ sourceFile:contextualTyping.ts
1 >
>}
2 > ;
1 >Emitted(141, 2) Source(226, 2) + SourceIndex(0)
2 >Emitted(141, 3) Source(226, 3) + SourceIndex(0)
1 >Emitted(136, 2) Source(219, 2) + SourceIndex(0)
2 >Emitted(136, 3) Source(219, 3) + SourceIndex(0)
---
>>>var x = {};
1->
@ -3532,11 +3437,11 @@ sourceFile:contextualTyping.ts
4 > : B =
5 > { }
6 > ;
1->Emitted(142, 1) Source(230, 1) + SourceIndex(0)
2 >Emitted(142, 5) Source(230, 5) + SourceIndex(0)
3 >Emitted(142, 6) Source(230, 6) + SourceIndex(0)
4 >Emitted(142, 9) Source(230, 12) + SourceIndex(0)
5 >Emitted(142, 11) Source(230, 15) + SourceIndex(0)
6 >Emitted(142, 12) Source(230, 16) + SourceIndex(0)
1->Emitted(137, 1) Source(223, 1) + SourceIndex(0)
2 >Emitted(137, 5) Source(223, 5) + SourceIndex(0)
3 >Emitted(137, 6) Source(223, 6) + SourceIndex(0)
4 >Emitted(137, 9) Source(223, 12) + SourceIndex(0)
5 >Emitted(137, 11) Source(223, 15) + SourceIndex(0)
6 >Emitted(137, 12) Source(223, 16) + SourceIndex(0)
---
>>>//# sourceMappingURL=contextualTyping.js.map

View File

@ -659,20 +659,6 @@ declare class Point
}
function Point(x, y) {
>Point : Symbol(Point, Decl(contextualTyping.ts, 204, 1))
>x : Symbol(x, Decl(contextualTyping.ts, 206, 15))
>y : Symbol(y, Decl(contextualTyping.ts, 206, 17))
this.x = x;
>x : Symbol(x, Decl(contextualTyping.ts, 206, 15))
this.y = y;
>y : Symbol(y, Decl(contextualTyping.ts, 206, 17))
return this;
}
Point.origin = new Point(0, 0);
>Point.origin : Symbol(Point.origin, Decl(contextualTyping.ts, 201, 41))
>Point : Symbol(Point, Decl(contextualTyping.ts, 192, 19))
@ -685,13 +671,13 @@ Point.prototype.add = function(dx, dy) {
>Point : Symbol(Point, Decl(contextualTyping.ts, 192, 19))
>prototype : Symbol(Point.prototype)
>add : Symbol(Point.add, Decl(contextualTyping.ts, 200, 16))
>dx : Symbol(dx, Decl(contextualTyping.ts, 215, 31))
>dy : Symbol(dy, Decl(contextualTyping.ts, 215, 34))
>dx : Symbol(dx, Decl(contextualTyping.ts, 208, 31))
>dy : Symbol(dy, Decl(contextualTyping.ts, 208, 34))
return new Point(this.x + dx, this.y + dy);
>Point : Symbol(Point, Decl(contextualTyping.ts, 192, 19))
>dx : Symbol(dx, Decl(contextualTyping.ts, 215, 31))
>dy : Symbol(dy, Decl(contextualTyping.ts, 215, 34))
>dx : Symbol(dx, Decl(contextualTyping.ts, 208, 31))
>dy : Symbol(dy, Decl(contextualTyping.ts, 208, 34))
};
@ -701,32 +687,32 @@ Point.prototype = {
>prototype : Symbol(Point.prototype)
x: 0,
>x : Symbol(x, Decl(contextualTyping.ts, 219, 19))
>x : Symbol(x, Decl(contextualTyping.ts, 212, 19))
y: 0,
>y : Symbol(y, Decl(contextualTyping.ts, 220, 9))
>y : Symbol(y, Decl(contextualTyping.ts, 213, 9))
add: function(dx, dy) {
>add : Symbol(add, Decl(contextualTyping.ts, 221, 9))
>dx : Symbol(dx, Decl(contextualTyping.ts, 222, 18))
>dy : Symbol(dy, Decl(contextualTyping.ts, 222, 21))
>add : Symbol(add, Decl(contextualTyping.ts, 214, 9))
>dx : Symbol(dx, Decl(contextualTyping.ts, 215, 18))
>dy : Symbol(dy, Decl(contextualTyping.ts, 215, 21))
return new Point(this.x + dx, this.y + dy);
>Point : Symbol(Point, Decl(contextualTyping.ts, 192, 19))
>dx : Symbol(dx, Decl(contextualTyping.ts, 222, 18))
>dy : Symbol(dy, Decl(contextualTyping.ts, 222, 21))
>dx : Symbol(dx, Decl(contextualTyping.ts, 215, 18))
>dy : Symbol(dy, Decl(contextualTyping.ts, 215, 21))
}
};
interface A { x: string; }
>A : Symbol(A, Decl(contextualTyping.ts, 225, 2))
>x : Symbol(A.x, Decl(contextualTyping.ts, 227, 13))
>A : Symbol(A, Decl(contextualTyping.ts, 218, 2))
>x : Symbol(A.x, Decl(contextualTyping.ts, 220, 13))
interface B extends A { }
>B : Symbol(B, Decl(contextualTyping.ts, 227, 26))
>A : Symbol(A, Decl(contextualTyping.ts, 225, 2))
>B : Symbol(B, Decl(contextualTyping.ts, 220, 26))
>A : Symbol(A, Decl(contextualTyping.ts, 218, 2))
var x: B = { };
>x : Symbol(x, Decl(contextualTyping.ts, 229, 3))
>B : Symbol(B, Decl(contextualTyping.ts, 227, 26))
>x : Symbol(x, Decl(contextualTyping.ts, 222, 3))
>B : Symbol(B, Decl(contextualTyping.ts, 220, 26))

View File

@ -860,29 +860,6 @@ declare class Point
}
function Point(x, y) {
>Point : (x: any, y: any) => any
>x : any
>y : any
this.x = x;
>this.x = x : any
>this.x : any
>this : any
>x : any
>x : any
this.y = y;
>this.y = y : any
>this.y : any
>this : any
>y : any
>y : any
return this;
>this : any
}
Point.origin = new Point(0, 0);
>Point.origin = new Point(0, 0) : Point
>Point.origin : Point

View File

@ -100,7 +100,7 @@ module M {
>M : Symbol(M, Decl(duplicateSymbolsExportMatching.ts, 0, 0), Decl(duplicateSymbolsExportMatching.ts, 3, 1), Decl(duplicateSymbolsExportMatching.ts, 7, 1), Decl(duplicateSymbolsExportMatching.ts, 27, 1), Decl(duplicateSymbolsExportMatching.ts, 45, 1) ... and 1 more)
module F {
>F : Symbol(F, Decl(duplicateSymbolsExportMatching.ts, 47, 10), Decl(duplicateSymbolsExportMatching.ts, 50, 5))
>F : Symbol(F, Decl(duplicateSymbolsExportMatching.ts, 50, 5), Decl(duplicateSymbolsExportMatching.ts, 47, 10))
var t;
>t : Symbol(t, Decl(duplicateSymbolsExportMatching.ts, 49, 11))

View File

@ -22,14 +22,14 @@ import { Constructor, MyBaseClass } from './BaseClass';
>MyBaseClass : Symbol(MyBaseClass, Decl(MixinClass.ts, 0, 21))
export interface MyMixin {
>MyMixin : Symbol(MyMixin, Decl(MixinClass.ts, 0, 55), Decl(MixinClass.ts, 4, 1))
>MyMixin : Symbol(MyMixin, Decl(MixinClass.ts, 4, 1), Decl(MixinClass.ts, 0, 55))
mixinProperty: string;
>mixinProperty : Symbol(MyMixin.mixinProperty, Decl(MixinClass.ts, 2, 26))
}
export function MyMixin<T extends Constructor<MyBaseClass<any>>>(base: T): T & Constructor<MyMixin> {
>MyMixin : Symbol(MyMixin, Decl(MixinClass.ts, 0, 55), Decl(MixinClass.ts, 4, 1))
>MyMixin : Symbol(MyMixin, Decl(MixinClass.ts, 4, 1), Decl(MixinClass.ts, 0, 55))
>T : Symbol(T, Decl(MixinClass.ts, 6, 24))
>Constructor : Symbol(Constructor, Decl(MixinClass.ts, 0, 8))
>MyBaseClass : Symbol(MyBaseClass, Decl(MixinClass.ts, 0, 21))
@ -37,7 +37,7 @@ export function MyMixin<T extends Constructor<MyBaseClass<any>>>(base: T): T & C
>T : Symbol(T, Decl(MixinClass.ts, 6, 24))
>T : Symbol(T, Decl(MixinClass.ts, 6, 24))
>Constructor : Symbol(Constructor, Decl(MixinClass.ts, 0, 8))
>MyMixin : Symbol(MyMixin, Decl(MixinClass.ts, 0, 55), Decl(MixinClass.ts, 4, 1))
>MyMixin : Symbol(MyMixin, Decl(MixinClass.ts, 4, 1), Decl(MixinClass.ts, 0, 55))
return class extends base {
>base : Symbol(base, Decl(MixinClass.ts, 6, 65))

View File

@ -1,10 +1,10 @@
=== tests/cases/compiler/exportRedeclarationTypeAliases.ts ===
export type Foo = number;
>Foo : Symbol(Foo, Decl(exportRedeclarationTypeAliases.ts, 0, 0), Decl(exportRedeclarationTypeAliases.ts, 0, 25), Decl(exportRedeclarationTypeAliases.ts, 1, 30))
>Foo : Symbol(Foo, Decl(exportRedeclarationTypeAliases.ts, 0, 25), Decl(exportRedeclarationTypeAliases.ts, 1, 30), Decl(exportRedeclarationTypeAliases.ts, 0, 0))
export function Foo(): number;
>Foo : Symbol(Foo, Decl(exportRedeclarationTypeAliases.ts, 0, 0), Decl(exportRedeclarationTypeAliases.ts, 0, 25), Decl(exportRedeclarationTypeAliases.ts, 1, 30))
>Foo : Symbol(Foo, Decl(exportRedeclarationTypeAliases.ts, 0, 25), Decl(exportRedeclarationTypeAliases.ts, 1, 30), Decl(exportRedeclarationTypeAliases.ts, 0, 0))
export function Foo(): any {}
>Foo : Symbol(Foo, Decl(exportRedeclarationTypeAliases.ts, 0, 0), Decl(exportRedeclarationTypeAliases.ts, 0, 25), Decl(exportRedeclarationTypeAliases.ts, 1, 30))
>Foo : Symbol(Foo, Decl(exportRedeclarationTypeAliases.ts, 0, 25), Decl(exportRedeclarationTypeAliases.ts, 1, 30), Decl(exportRedeclarationTypeAliases.ts, 0, 0))

View File

@ -2,14 +2,13 @@ tests/cases/compiler/funClodule.ts(1,18): error TS2300: Duplicate identifier 'fo
tests/cases/compiler/funClodule.ts(2,16): error TS2300: Duplicate identifier 'foo'.
tests/cases/compiler/funClodule.ts(5,15): error TS2300: Duplicate identifier 'foo'.
tests/cases/compiler/funClodule.ts(8,15): error TS2300: Duplicate identifier 'foo2'.
tests/cases/compiler/funClodule.ts(9,16): error TS2300: Duplicate identifier 'foo2'.
tests/cases/compiler/funClodule.ts(12,18): error TS2300: Duplicate identifier 'foo2'.
tests/cases/compiler/funClodule.ts(15,10): error TS2300: Duplicate identifier 'foo3'.
tests/cases/compiler/funClodule.ts(16,8): error TS2300: Duplicate identifier 'foo3'.
tests/cases/compiler/funClodule.ts(19,7): error TS2300: Duplicate identifier 'foo3'.
==== tests/cases/compiler/funClodule.ts (9 errors) ====
==== tests/cases/compiler/funClodule.ts (8 errors) ====
declare function foo();
~~~
!!! error TS2300: Duplicate identifier 'foo'.
@ -27,8 +26,6 @@ tests/cases/compiler/funClodule.ts(19,7): error TS2300: Duplicate identifier 'fo
~~~~
!!! error TS2300: Duplicate identifier 'foo2'.
declare module foo2 {
~~~~
!!! error TS2300: Duplicate identifier 'foo2'.
export function x(): any;
}
declare function foo2(); // Should error

View File

@ -13,16 +13,16 @@ declare class foo { } // Should error
declare class foo2 { }
>foo2 : Symbol(foo2, Decl(funClodule.ts, 4, 21), Decl(funClodule.ts, 7, 22))
>foo2 : Symbol(foo2, Decl(funClodule.ts, 4, 21))
declare module foo2 {
>foo2 : Symbol(foo2, Decl(funClodule.ts, 4, 21), Decl(funClodule.ts, 7, 22))
>foo2 : Symbol(foo2, Decl(funClodule.ts, 10, 1), Decl(funClodule.ts, 7, 22))
export function x(): any;
>x : Symbol(x, Decl(funClodule.ts, 8, 21))
}
declare function foo2(); // Should error
>foo2 : Symbol(foo2, Decl(funClodule.ts, 10, 1))
>foo2 : Symbol(foo2, Decl(funClodule.ts, 10, 1), Decl(funClodule.ts, 7, 22))
function foo3() { }

View File

@ -22,7 +22,7 @@ declare module foo2 {
>x : () => any
}
declare function foo2(); // Should error
>foo2 : () => any
>foo2 : typeof foo2
function foo3() { }

View File

@ -5,7 +5,7 @@ export function f() {
=== tests/cases/compiler/f2.ts ===
import {f} from './f1';
>f : Symbol(f, Decl(f2.ts, 0, 8), Decl(f2.ts, 0, 23))
>f : Symbol(f, Decl(f2.ts, 0, 23), Decl(f2.ts, 0, 8))
export function f() {
>f : Symbol(f, Decl(f2.ts, 0, 23))

View File

@ -1,12 +1,12 @@
=== tests/cases/compiler/functionDeclarationWithResolutionOfTypeOfSameName01.ts ===
interface f {
>f : Symbol(f, Decl(functionDeclarationWithResolutionOfTypeOfSameName01.ts, 0, 0), Decl(functionDeclarationWithResolutionOfTypeOfSameName01.ts, 1, 1))
>f : Symbol(f, Decl(functionDeclarationWithResolutionOfTypeOfSameName01.ts, 1, 1), Decl(functionDeclarationWithResolutionOfTypeOfSameName01.ts, 0, 0))
}
function f() {
>f : Symbol(f, Decl(functionDeclarationWithResolutionOfTypeOfSameName01.ts, 0, 0), Decl(functionDeclarationWithResolutionOfTypeOfSameName01.ts, 1, 1))
>f : Symbol(f, Decl(functionDeclarationWithResolutionOfTypeOfSameName01.ts, 1, 1), Decl(functionDeclarationWithResolutionOfTypeOfSameName01.ts, 0, 0))
<f>f;
>f : Symbol(f, Decl(functionDeclarationWithResolutionOfTypeOfSameName01.ts, 0, 0), Decl(functionDeclarationWithResolutionOfTypeOfSameName01.ts, 1, 1))
>f : Symbol(f, Decl(functionDeclarationWithResolutionOfTypeOfSameName01.ts, 0, 0), Decl(functionDeclarationWithResolutionOfTypeOfSameName01.ts, 1, 1))
>f : Symbol(f, Decl(functionDeclarationWithResolutionOfTypeOfSameName01.ts, 1, 1), Decl(functionDeclarationWithResolutionOfTypeOfSameName01.ts, 0, 0))
>f : Symbol(f, Decl(functionDeclarationWithResolutionOfTypeOfSameName01.ts, 1, 1), Decl(functionDeclarationWithResolutionOfTypeOfSameName01.ts, 0, 0))
}

View File

@ -0,0 +1,19 @@
=== tests/cases/conformance/salsa/a.js ===
OOOrder.prototype.m = function () {
>OOOrder.prototype : Symbol(OOOrder.m, Decl(a.js, 0, 0))
>OOOrder : Symbol(OOOrder, Decl(a.js, 2, 1))
>prototype : Symbol(Function.prototype, Decl(lib.d.ts, --, --))
>m : Symbol(OOOrder.m, Decl(a.js, 0, 0))
this.p = 1
>this.p : Symbol(OOOrder.p, Decl(a.js, 0, 35))
>this : Symbol(OOOrder, Decl(a.js, 2, 1))
>p : Symbol(OOOrder.p, Decl(a.js, 0, 35))
}
function OOOrder() {
>OOOrder : Symbol(OOOrder, Decl(a.js, 2, 1))
this.x = 1
>x : Symbol(OOOrder.x, Decl(a.js, 3, 20))
}

View File

@ -0,0 +1,28 @@
=== tests/cases/conformance/salsa/a.js ===
OOOrder.prototype.m = function () {
>OOOrder.prototype.m = function () { this.p = 1} : () => void
>OOOrder.prototype.m : any
>OOOrder.prototype : any
>OOOrder : () => void
>prototype : any
>m : any
>function () { this.p = 1} : () => void
this.p = 1
>this.p = 1 : 1
>this.p : number
>this : { x: number; m: () => void; p: number; }
>p : number
>1 : 1
}
function OOOrder() {
>OOOrder : () => void
this.x = 1
>this.x = 1 : 1
>this.x : any
>this : any
>x : any
>1 : 1
}

View File

@ -1,6 +1,6 @@
=== tests/cases/conformance/jsx/inline/renderer.d.ts ===
export namespace dom {
>dom : Symbol(dom, Decl(renderer.d.ts, 0, 0), Decl(renderer.d.ts, 17, 1))
>dom : Symbol(dom, Decl(renderer.d.ts, 17, 1), Decl(renderer.d.ts, 0, 0))
namespace JSX {
>JSX : Symbol(JSX, Decl(renderer.d.ts, 0, 22))
@ -44,14 +44,14 @@ export namespace dom {
}
}
export function dom(): dom.JSX.Element;
>dom : Symbol(dom, Decl(renderer.d.ts, 0, 0), Decl(renderer.d.ts, 17, 1))
>dom : Symbol(dom, Decl(renderer.d.ts, 0, 0), Decl(renderer.d.ts, 17, 1))
>dom : Symbol(dom, Decl(renderer.d.ts, 17, 1), Decl(renderer.d.ts, 0, 0))
>dom : Symbol(dom, Decl(renderer.d.ts, 17, 1), Decl(renderer.d.ts, 0, 0))
>JSX : Symbol(dom.JSX, Decl(renderer.d.ts, 0, 22))
>Element : Symbol(dom.JSX.Element, Decl(renderer.d.ts, 4, 9))
=== tests/cases/conformance/jsx/inline/renderer2.d.ts ===
export namespace predom {
>predom : Symbol(predom, Decl(renderer2.d.ts, 0, 0), Decl(renderer2.d.ts, 17, 1))
>predom : Symbol(predom, Decl(renderer2.d.ts, 17, 1), Decl(renderer2.d.ts, 0, 0))
namespace JSX {
>JSX : Symbol(JSX, Decl(renderer2.d.ts, 0, 25))
@ -95,8 +95,8 @@ export namespace predom {
}
}
export function predom(): predom.JSX.Element;
>predom : Symbol(predom, Decl(renderer2.d.ts, 0, 0), Decl(renderer2.d.ts, 17, 1))
>predom : Symbol(predom, Decl(renderer2.d.ts, 0, 0), Decl(renderer2.d.ts, 17, 1))
>predom : Symbol(predom, Decl(renderer2.d.ts, 17, 1), Decl(renderer2.d.ts, 0, 0))
>predom : Symbol(predom, Decl(renderer2.d.ts, 17, 1), Decl(renderer2.d.ts, 0, 0))
>JSX : Symbol(predom.JSX, Decl(renderer2.d.ts, 0, 25))
>Element : Symbol(predom.JSX.Element, Decl(renderer2.d.ts, 4, 9))

View File

@ -40,7 +40,7 @@ export function dom(): JSX.Element;
=== tests/cases/conformance/jsx/inline/renderer2.d.ts ===
export namespace predom {
>predom : Symbol(predom, Decl(renderer2.d.ts, 0, 0), Decl(renderer2.d.ts, 13, 1))
>predom : Symbol(predom, Decl(renderer2.d.ts, 13, 1), Decl(renderer2.d.ts, 0, 0))
namespace JSX {
>JSX : Symbol(JSX, Decl(renderer2.d.ts, 0, 25))
@ -74,8 +74,8 @@ export namespace predom {
}
}
export function predom(): predom.JSX.Element;
>predom : Symbol(predom, Decl(renderer2.d.ts, 0, 0), Decl(renderer2.d.ts, 13, 1))
>predom : Symbol(predom, Decl(renderer2.d.ts, 0, 0), Decl(renderer2.d.ts, 13, 1))
>predom : Symbol(predom, Decl(renderer2.d.ts, 13, 1), Decl(renderer2.d.ts, 0, 0))
>predom : Symbol(predom, Decl(renderer2.d.ts, 13, 1), Decl(renderer2.d.ts, 0, 0))
>JSX : Symbol(predom.JSX, Decl(renderer2.d.ts, 0, 25))
>Element : Symbol(predom.JSX.Element, Decl(renderer2.d.ts, 4, 9))

View File

@ -12,10 +12,10 @@ class I2 { }
>I2 : Symbol(I2, Decl(interfaceDeclaration2.ts, 1, 13), Decl(interfaceDeclaration2.ts, 3, 16))
interface I3 { }
>I3 : Symbol(I3, Decl(interfaceDeclaration2.ts, 4, 12), Decl(interfaceDeclaration2.ts, 6, 16))
>I3 : Symbol(I3, Decl(interfaceDeclaration2.ts, 6, 16), Decl(interfaceDeclaration2.ts, 4, 12))
function I3() { }
>I3 : Symbol(I3, Decl(interfaceDeclaration2.ts, 4, 12), Decl(interfaceDeclaration2.ts, 6, 16))
>I3 : Symbol(I3, Decl(interfaceDeclaration2.ts, 6, 16), Decl(interfaceDeclaration2.ts, 4, 12))
interface I4 { }
>I4 : Symbol(I4, Decl(interfaceDeclaration2.ts, 7, 17), Decl(interfaceDeclaration2.ts, 10, 3))

View File

@ -61,55 +61,55 @@ interface I7 extends T7 { x: string }
>x : Symbol(I7.x, Decl(interfaceExtendsObjectIntersection.ts, 14, 25))
type Constructor<T> = new () => T;
>Constructor : Symbol(Constructor, Decl(interfaceExtendsObjectIntersection.ts, 14, 37), Decl(interfaceExtendsObjectIntersection.ts, 16, 34))
>Constructor : Symbol(Constructor, Decl(interfaceExtendsObjectIntersection.ts, 16, 34), Decl(interfaceExtendsObjectIntersection.ts, 14, 37))
>T : Symbol(T, Decl(interfaceExtendsObjectIntersection.ts, 16, 17))
>T : Symbol(T, Decl(interfaceExtendsObjectIntersection.ts, 16, 17))
declare function Constructor<T>(): Constructor<T>;
>Constructor : Symbol(Constructor, Decl(interfaceExtendsObjectIntersection.ts, 14, 37), Decl(interfaceExtendsObjectIntersection.ts, 16, 34))
>Constructor : Symbol(Constructor, Decl(interfaceExtendsObjectIntersection.ts, 16, 34), Decl(interfaceExtendsObjectIntersection.ts, 14, 37))
>T : Symbol(T, Decl(interfaceExtendsObjectIntersection.ts, 17, 29))
>Constructor : Symbol(Constructor, Decl(interfaceExtendsObjectIntersection.ts, 14, 37), Decl(interfaceExtendsObjectIntersection.ts, 16, 34))
>Constructor : Symbol(Constructor, Decl(interfaceExtendsObjectIntersection.ts, 16, 34), Decl(interfaceExtendsObjectIntersection.ts, 14, 37))
>T : Symbol(T, Decl(interfaceExtendsObjectIntersection.ts, 17, 29))
class C1 extends Constructor<I1>() { x: string }
>C1 : Symbol(C1, Decl(interfaceExtendsObjectIntersection.ts, 17, 50))
>Constructor : Symbol(Constructor, Decl(interfaceExtendsObjectIntersection.ts, 14, 37), Decl(interfaceExtendsObjectIntersection.ts, 16, 34))
>Constructor : Symbol(Constructor, Decl(interfaceExtendsObjectIntersection.ts, 16, 34), Decl(interfaceExtendsObjectIntersection.ts, 14, 37))
>I1 : Symbol(I1, Decl(interfaceExtendsObjectIntersection.ts, 6, 45))
>x : Symbol(C1.x, Decl(interfaceExtendsObjectIntersection.ts, 19, 36))
class C2 extends Constructor<I2>() { x: string }
>C2 : Symbol(C2, Decl(interfaceExtendsObjectIntersection.ts, 19, 48))
>Constructor : Symbol(Constructor, Decl(interfaceExtendsObjectIntersection.ts, 14, 37), Decl(interfaceExtendsObjectIntersection.ts, 16, 34))
>Constructor : Symbol(Constructor, Decl(interfaceExtendsObjectIntersection.ts, 16, 34), Decl(interfaceExtendsObjectIntersection.ts, 14, 37))
>I2 : Symbol(I2, Decl(interfaceExtendsObjectIntersection.ts, 8, 37))
>x : Symbol(C2.x, Decl(interfaceExtendsObjectIntersection.ts, 20, 36))
class C3 extends Constructor<I3>() { x: string }
>C3 : Symbol(C3, Decl(interfaceExtendsObjectIntersection.ts, 20, 48))
>Constructor : Symbol(Constructor, Decl(interfaceExtendsObjectIntersection.ts, 14, 37), Decl(interfaceExtendsObjectIntersection.ts, 16, 34))
>Constructor : Symbol(Constructor, Decl(interfaceExtendsObjectIntersection.ts, 16, 34), Decl(interfaceExtendsObjectIntersection.ts, 14, 37))
>I3 : Symbol(I3, Decl(interfaceExtendsObjectIntersection.ts, 9, 37))
>x : Symbol(C3.x, Decl(interfaceExtendsObjectIntersection.ts, 21, 36))
class C4 extends Constructor<I4>() { x: string }
>C4 : Symbol(C4, Decl(interfaceExtendsObjectIntersection.ts, 21, 48))
>Constructor : Symbol(Constructor, Decl(interfaceExtendsObjectIntersection.ts, 14, 37), Decl(interfaceExtendsObjectIntersection.ts, 16, 34))
>Constructor : Symbol(Constructor, Decl(interfaceExtendsObjectIntersection.ts, 16, 34), Decl(interfaceExtendsObjectIntersection.ts, 14, 37))
>I4 : Symbol(I4, Decl(interfaceExtendsObjectIntersection.ts, 10, 37))
>x : Symbol(C4.x, Decl(interfaceExtendsObjectIntersection.ts, 22, 36))
class C5 extends Constructor<I5>() { x: string }
>C5 : Symbol(C5, Decl(interfaceExtendsObjectIntersection.ts, 22, 48))
>Constructor : Symbol(Constructor, Decl(interfaceExtendsObjectIntersection.ts, 14, 37), Decl(interfaceExtendsObjectIntersection.ts, 16, 34))
>Constructor : Symbol(Constructor, Decl(interfaceExtendsObjectIntersection.ts, 16, 34), Decl(interfaceExtendsObjectIntersection.ts, 14, 37))
>I5 : Symbol(I5, Decl(interfaceExtendsObjectIntersection.ts, 11, 37))
>x : Symbol(C5.x, Decl(interfaceExtendsObjectIntersection.ts, 23, 36))
class C6 extends Constructor<I6>() { x: string }
>C6 : Symbol(C6, Decl(interfaceExtendsObjectIntersection.ts, 23, 48))
>Constructor : Symbol(Constructor, Decl(interfaceExtendsObjectIntersection.ts, 14, 37), Decl(interfaceExtendsObjectIntersection.ts, 16, 34))
>Constructor : Symbol(Constructor, Decl(interfaceExtendsObjectIntersection.ts, 16, 34), Decl(interfaceExtendsObjectIntersection.ts, 14, 37))
>I6 : Symbol(I6, Decl(interfaceExtendsObjectIntersection.ts, 12, 37))
>x : Symbol(C6.x, Decl(interfaceExtendsObjectIntersection.ts, 24, 36))
class C7 extends Constructor<I7>() { x: string }
>C7 : Symbol(C7, Decl(interfaceExtendsObjectIntersection.ts, 24, 48))
>Constructor : Symbol(Constructor, Decl(interfaceExtendsObjectIntersection.ts, 14, 37), Decl(interfaceExtendsObjectIntersection.ts, 16, 34))
>Constructor : Symbol(Constructor, Decl(interfaceExtendsObjectIntersection.ts, 16, 34), Decl(interfaceExtendsObjectIntersection.ts, 14, 37))
>I7 : Symbol(I7, Decl(interfaceExtendsObjectIntersection.ts, 13, 37))
>x : Symbol(C7.x, Decl(interfaceExtendsObjectIntersection.ts, 25, 36))
@ -200,28 +200,28 @@ interface I23 extends Identifiable<T1 & { b: number}> { x: string }
class C20 extends Constructor<Partial<T1>>() { x: string }
>C20 : Symbol(C20, Decl(interfaceExtendsObjectIntersection.ts, 47, 67))
>Constructor : Symbol(Constructor, Decl(interfaceExtendsObjectIntersection.ts, 14, 37), Decl(interfaceExtendsObjectIntersection.ts, 16, 34))
>Constructor : Symbol(Constructor, Decl(interfaceExtendsObjectIntersection.ts, 16, 34), Decl(interfaceExtendsObjectIntersection.ts, 14, 37))
>Partial : Symbol(Partial, Decl(lib.d.ts, --, --))
>T1 : Symbol(T1, Decl(interfaceExtendsObjectIntersection.ts, 0, 0))
>x : Symbol(C20.x, Decl(interfaceExtendsObjectIntersection.ts, 49, 46))
class C21 extends Constructor<Readonly<T1>>() { x: string }
>C21 : Symbol(C21, Decl(interfaceExtendsObjectIntersection.ts, 49, 58))
>Constructor : Symbol(Constructor, Decl(interfaceExtendsObjectIntersection.ts, 14, 37), Decl(interfaceExtendsObjectIntersection.ts, 16, 34))
>Constructor : Symbol(Constructor, Decl(interfaceExtendsObjectIntersection.ts, 16, 34), Decl(interfaceExtendsObjectIntersection.ts, 14, 37))
>Readonly : Symbol(Readonly, Decl(lib.d.ts, --, --))
>T1 : Symbol(T1, Decl(interfaceExtendsObjectIntersection.ts, 0, 0))
>x : Symbol(C21.x, Decl(interfaceExtendsObjectIntersection.ts, 50, 47))
class C22 extends Constructor<Identifiable<T1>>() { x: string }
>C22 : Symbol(C22, Decl(interfaceExtendsObjectIntersection.ts, 50, 59))
>Constructor : Symbol(Constructor, Decl(interfaceExtendsObjectIntersection.ts, 14, 37), Decl(interfaceExtendsObjectIntersection.ts, 16, 34))
>Constructor : Symbol(Constructor, Decl(interfaceExtendsObjectIntersection.ts, 16, 34), Decl(interfaceExtendsObjectIntersection.ts, 14, 37))
>Identifiable : Symbol(Identifiable, Decl(interfaceExtendsObjectIntersection.ts, 40, 39))
>T1 : Symbol(T1, Decl(interfaceExtendsObjectIntersection.ts, 0, 0))
>x : Symbol(C22.x, Decl(interfaceExtendsObjectIntersection.ts, 51, 51))
class C23 extends Constructor<Identifiable<T1 & { b: number}>>() { x: string }
>C23 : Symbol(C23, Decl(interfaceExtendsObjectIntersection.ts, 51, 63))
>Constructor : Symbol(Constructor, Decl(interfaceExtendsObjectIntersection.ts, 14, 37), Decl(interfaceExtendsObjectIntersection.ts, 16, 34))
>Constructor : Symbol(Constructor, Decl(interfaceExtendsObjectIntersection.ts, 16, 34), Decl(interfaceExtendsObjectIntersection.ts, 14, 37))
>Identifiable : Symbol(Identifiable, Decl(interfaceExtendsObjectIntersection.ts, 40, 39))
>T1 : Symbol(T1, Decl(interfaceExtendsObjectIntersection.ts, 0, 0))
>b : Symbol(b, Decl(interfaceExtendsObjectIntersection.ts, 52, 49))

View File

@ -44,43 +44,43 @@ interface I5 extends T5 { c: number }
>c : Symbol(I5.c, Decl(interfaceExtendsObjectIntersectionErrors.ts, 10, 25))
type Constructor<T> = new () => T;
>Constructor : Symbol(Constructor, Decl(interfaceExtendsObjectIntersectionErrors.ts, 10, 37), Decl(interfaceExtendsObjectIntersectionErrors.ts, 12, 34))
>Constructor : Symbol(Constructor, Decl(interfaceExtendsObjectIntersectionErrors.ts, 12, 34), Decl(interfaceExtendsObjectIntersectionErrors.ts, 10, 37))
>T : Symbol(T, Decl(interfaceExtendsObjectIntersectionErrors.ts, 12, 17))
>T : Symbol(T, Decl(interfaceExtendsObjectIntersectionErrors.ts, 12, 17))
declare function Constructor<T>(): Constructor<T>;
>Constructor : Symbol(Constructor, Decl(interfaceExtendsObjectIntersectionErrors.ts, 10, 37), Decl(interfaceExtendsObjectIntersectionErrors.ts, 12, 34))
>Constructor : Symbol(Constructor, Decl(interfaceExtendsObjectIntersectionErrors.ts, 12, 34), Decl(interfaceExtendsObjectIntersectionErrors.ts, 10, 37))
>T : Symbol(T, Decl(interfaceExtendsObjectIntersectionErrors.ts, 13, 29))
>Constructor : Symbol(Constructor, Decl(interfaceExtendsObjectIntersectionErrors.ts, 10, 37), Decl(interfaceExtendsObjectIntersectionErrors.ts, 12, 34))
>Constructor : Symbol(Constructor, Decl(interfaceExtendsObjectIntersectionErrors.ts, 12, 34), Decl(interfaceExtendsObjectIntersectionErrors.ts, 10, 37))
>T : Symbol(T, Decl(interfaceExtendsObjectIntersectionErrors.ts, 13, 29))
class C1 extends Constructor<T1>() { a: string }
>C1 : Symbol(C1, Decl(interfaceExtendsObjectIntersectionErrors.ts, 13, 50))
>Constructor : Symbol(Constructor, Decl(interfaceExtendsObjectIntersectionErrors.ts, 10, 37), Decl(interfaceExtendsObjectIntersectionErrors.ts, 12, 34))
>Constructor : Symbol(Constructor, Decl(interfaceExtendsObjectIntersectionErrors.ts, 12, 34), Decl(interfaceExtendsObjectIntersectionErrors.ts, 10, 37))
>T1 : Symbol(T1, Decl(interfaceExtendsObjectIntersectionErrors.ts, 0, 0))
>a : Symbol(C1.a, Decl(interfaceExtendsObjectIntersectionErrors.ts, 15, 36))
class C2 extends Constructor<T2>() { b: string }
>C2 : Symbol(C2, Decl(interfaceExtendsObjectIntersectionErrors.ts, 15, 48))
>Constructor : Symbol(Constructor, Decl(interfaceExtendsObjectIntersectionErrors.ts, 10, 37), Decl(interfaceExtendsObjectIntersectionErrors.ts, 12, 34))
>Constructor : Symbol(Constructor, Decl(interfaceExtendsObjectIntersectionErrors.ts, 12, 34), Decl(interfaceExtendsObjectIntersectionErrors.ts, 10, 37))
>T2 : Symbol(T2, Decl(interfaceExtendsObjectIntersectionErrors.ts, 0, 24))
>b : Symbol(C2.b, Decl(interfaceExtendsObjectIntersectionErrors.ts, 16, 36))
class C3 extends Constructor<T3>() { length: string }
>C3 : Symbol(C3, Decl(interfaceExtendsObjectIntersectionErrors.ts, 16, 48))
>Constructor : Symbol(Constructor, Decl(interfaceExtendsObjectIntersectionErrors.ts, 10, 37), Decl(interfaceExtendsObjectIntersectionErrors.ts, 12, 34))
>Constructor : Symbol(Constructor, Decl(interfaceExtendsObjectIntersectionErrors.ts, 12, 34), Decl(interfaceExtendsObjectIntersectionErrors.ts, 10, 37))
>T3 : Symbol(T3, Decl(interfaceExtendsObjectIntersectionErrors.ts, 1, 29))
>length : Symbol(C3.length, Decl(interfaceExtendsObjectIntersectionErrors.ts, 17, 36))
class C4 extends Constructor<T4>() { 0: number }
>C4 : Symbol(C4, Decl(interfaceExtendsObjectIntersectionErrors.ts, 17, 53))
>Constructor : Symbol(Constructor, Decl(interfaceExtendsObjectIntersectionErrors.ts, 10, 37), Decl(interfaceExtendsObjectIntersectionErrors.ts, 12, 34))
>Constructor : Symbol(Constructor, Decl(interfaceExtendsObjectIntersectionErrors.ts, 12, 34), Decl(interfaceExtendsObjectIntersectionErrors.ts, 10, 37))
>T4 : Symbol(T4, Decl(interfaceExtendsObjectIntersectionErrors.ts, 2, 19))
>0 : Symbol(C4[0], Decl(interfaceExtendsObjectIntersectionErrors.ts, 18, 36))
class C5 extends Constructor<T5>() { c: number }
>C5 : Symbol(C5, Decl(interfaceExtendsObjectIntersectionErrors.ts, 18, 48))
>Constructor : Symbol(Constructor, Decl(interfaceExtendsObjectIntersectionErrors.ts, 10, 37), Decl(interfaceExtendsObjectIntersectionErrors.ts, 12, 34))
>Constructor : Symbol(Constructor, Decl(interfaceExtendsObjectIntersectionErrors.ts, 12, 34), Decl(interfaceExtendsObjectIntersectionErrors.ts, 10, 37))
>T5 : Symbol(T5, Decl(interfaceExtendsObjectIntersectionErrors.ts, 3, 27))
>c : Symbol(C5.c, Decl(interfaceExtendsObjectIntersectionErrors.ts, 19, 36))

View File

@ -8,7 +8,7 @@ const wat: Runtype<any> = Num;
const Foo = Obj({ foo: Num })
>Foo : Symbol(Foo, Decl(invariantGenericErrorElaboration.ts, 3, 5))
>Obj : Symbol(Obj, Decl(invariantGenericErrorElaboration.ts, 13, 22), Decl(invariantGenericErrorElaboration.ts, 15, 111))
>Obj : Symbol(Obj, Decl(invariantGenericErrorElaboration.ts, 15, 111), Decl(invariantGenericErrorElaboration.ts, 13, 22))
>foo : Symbol(foo, Decl(invariantGenericErrorElaboration.ts, 3, 17))
>Num : Symbol(Num, Decl(invariantGenericErrorElaboration.ts, 8, 1), Decl(invariantGenericErrorElaboration.ts, 13, 13))
@ -37,7 +37,7 @@ declare const Num: Num
>Num : Symbol(Num, Decl(invariantGenericErrorElaboration.ts, 8, 1), Decl(invariantGenericErrorElaboration.ts, 13, 13))
interface Obj<O extends { [_ in string]: Runtype<any> }> extends Runtype<{[K in keyof O]: O[K]['witness'] }> {}
>Obj : Symbol(Obj, Decl(invariantGenericErrorElaboration.ts, 13, 22), Decl(invariantGenericErrorElaboration.ts, 15, 111))
>Obj : Symbol(Obj, Decl(invariantGenericErrorElaboration.ts, 15, 111), Decl(invariantGenericErrorElaboration.ts, 13, 22))
>O : Symbol(O, Decl(invariantGenericErrorElaboration.ts, 15, 14))
>_ : Symbol(_, Decl(invariantGenericErrorElaboration.ts, 15, 27))
>Runtype : Symbol(Runtype, Decl(invariantGenericErrorElaboration.ts, 3, 29))
@ -48,13 +48,13 @@ interface Obj<O extends { [_ in string]: Runtype<any> }> extends Runtype<{[K in
>K : Symbol(K, Decl(invariantGenericErrorElaboration.ts, 15, 75))
declare function Obj<O extends { [_: string]: Runtype<any> }>(fields: O): Obj<O>;
>Obj : Symbol(Obj, Decl(invariantGenericErrorElaboration.ts, 13, 22), Decl(invariantGenericErrorElaboration.ts, 15, 111))
>Obj : Symbol(Obj, Decl(invariantGenericErrorElaboration.ts, 15, 111), Decl(invariantGenericErrorElaboration.ts, 13, 22))
>O : Symbol(O, Decl(invariantGenericErrorElaboration.ts, 16, 21))
>_ : Symbol(_, Decl(invariantGenericErrorElaboration.ts, 16, 34))
>Runtype : Symbol(Runtype, Decl(invariantGenericErrorElaboration.ts, 3, 29))
>fields : Symbol(fields, Decl(invariantGenericErrorElaboration.ts, 16, 62))
>O : Symbol(O, Decl(invariantGenericErrorElaboration.ts, 16, 21))
>Obj : Symbol(Obj, Decl(invariantGenericErrorElaboration.ts, 13, 22), Decl(invariantGenericErrorElaboration.ts, 15, 111))
>Obj : Symbol(Obj, Decl(invariantGenericErrorElaboration.ts, 15, 111), Decl(invariantGenericErrorElaboration.ts, 13, 22))
>O : Symbol(O, Decl(invariantGenericErrorElaboration.ts, 16, 21))
interface Constraint<A extends Runtype<any>> extends Runtype<A['witness']> {

View File

@ -1,15 +1,15 @@
tests/cases/compiler/letAndVarRedeclaration.ts(1,5): error TS2451: Cannot redeclare block-scoped variable 'e0'.
tests/cases/compiler/letAndVarRedeclaration.ts(2,5): error TS2451: Cannot redeclare block-scoped variable 'e0'.
tests/cases/compiler/letAndVarRedeclaration.ts(3,10): error TS2451: Cannot redeclare block-scoped variable 'e0'.
tests/cases/compiler/letAndVarRedeclaration.ts(6,9): error TS2451: Cannot redeclare block-scoped variable 'x1'.
tests/cases/compiler/letAndVarRedeclaration.ts(7,9): error TS2451: Cannot redeclare block-scoped variable 'x1'.
tests/cases/compiler/letAndVarRedeclaration.ts(8,14): error TS2451: Cannot redeclare block-scoped variable 'x1'.
tests/cases/compiler/letAndVarRedeclaration.ts(1,5): error TS2300: Duplicate identifier 'e0'.
tests/cases/compiler/letAndVarRedeclaration.ts(2,5): error TS2300: Duplicate identifier 'e0'.
tests/cases/compiler/letAndVarRedeclaration.ts(3,10): error TS2300: Duplicate identifier 'e0'.
tests/cases/compiler/letAndVarRedeclaration.ts(6,9): error TS2300: Duplicate identifier 'x1'.
tests/cases/compiler/letAndVarRedeclaration.ts(7,9): error TS2300: Duplicate identifier 'x1'.
tests/cases/compiler/letAndVarRedeclaration.ts(8,14): error TS2300: Duplicate identifier 'x1'.
tests/cases/compiler/letAndVarRedeclaration.ts(12,9): error TS2451: Cannot redeclare block-scoped variable 'x'.
tests/cases/compiler/letAndVarRedeclaration.ts(14,13): error TS2451: Cannot redeclare block-scoped variable 'x'.
tests/cases/compiler/letAndVarRedeclaration.ts(17,18): error TS2451: Cannot redeclare block-scoped variable 'x'.
tests/cases/compiler/letAndVarRedeclaration.ts(22,9): error TS2451: Cannot redeclare block-scoped variable 'x2'.
tests/cases/compiler/letAndVarRedeclaration.ts(23,9): error TS2451: Cannot redeclare block-scoped variable 'x2'.
tests/cases/compiler/letAndVarRedeclaration.ts(24,14): error TS2451: Cannot redeclare block-scoped variable 'x2'.
tests/cases/compiler/letAndVarRedeclaration.ts(22,9): error TS2300: Duplicate identifier 'x2'.
tests/cases/compiler/letAndVarRedeclaration.ts(23,9): error TS2300: Duplicate identifier 'x2'.
tests/cases/compiler/letAndVarRedeclaration.ts(24,14): error TS2300: Duplicate identifier 'x2'.
tests/cases/compiler/letAndVarRedeclaration.ts(28,9): error TS2451: Cannot redeclare block-scoped variable 'x2'.
tests/cases/compiler/letAndVarRedeclaration.ts(30,13): error TS2451: Cannot redeclare block-scoped variable 'x2'.
tests/cases/compiler/letAndVarRedeclaration.ts(33,18): error TS2451: Cannot redeclare block-scoped variable 'x2'.
@ -24,24 +24,24 @@ tests/cases/compiler/letAndVarRedeclaration.ts(49,14): error TS2451: Cannot rede
==== tests/cases/compiler/letAndVarRedeclaration.ts (21 errors) ====
let e0
~~
!!! error TS2451: Cannot redeclare block-scoped variable 'e0'.
!!! error TS2300: Duplicate identifier 'e0'.
var e0;
~~
!!! error TS2451: Cannot redeclare block-scoped variable 'e0'.
!!! error TS2300: Duplicate identifier 'e0'.
function e0() { }
~~
!!! error TS2451: Cannot redeclare block-scoped variable 'e0'.
!!! error TS2300: Duplicate identifier 'e0'.
function f0() {
let x1;
~~
!!! error TS2451: Cannot redeclare block-scoped variable 'x1'.
!!! error TS2300: Duplicate identifier 'x1'.
var x1;
~~
!!! error TS2451: Cannot redeclare block-scoped variable 'x1'.
!!! error TS2300: Duplicate identifier 'x1'.
function x1() { }
~~
!!! error TS2451: Cannot redeclare block-scoped variable 'x1'.
!!! error TS2300: Duplicate identifier 'x1'.
}
function f1() {
@ -63,13 +63,13 @@ tests/cases/compiler/letAndVarRedeclaration.ts(49,14): error TS2451: Cannot rede
module M0 {
let x2;
~~
!!! error TS2451: Cannot redeclare block-scoped variable 'x2'.
!!! error TS2300: Duplicate identifier 'x2'.
var x2;
~~
!!! error TS2451: Cannot redeclare block-scoped variable 'x2'.
!!! error TS2300: Duplicate identifier 'x2'.
function x2() { }
~~
!!! error TS2451: Cannot redeclare block-scoped variable 'x2'.
!!! error TS2300: Duplicate identifier 'x2'.
}
module M1 {

View File

@ -69,20 +69,20 @@ const Printable = <T extends Constructor<Base>>(superClass: T): Constructor<Prin
}
interface Tagged {
>Tagged : Symbol(Tagged, Decl(mixinClassesAnnotated.ts, 22, 5), Decl(mixinClassesAnnotated.ts, 26, 1))
>Tagged : Symbol(Tagged, Decl(mixinClassesAnnotated.ts, 26, 1), Decl(mixinClassesAnnotated.ts, 22, 5))
_tag: string;
>_tag : Symbol(Tagged._tag, Decl(mixinClassesAnnotated.ts, 24, 18))
}
function Tagged<T extends Constructor<{}>>(superClass: T): Constructor<Tagged> & T {
>Tagged : Symbol(Tagged, Decl(mixinClassesAnnotated.ts, 22, 5), Decl(mixinClassesAnnotated.ts, 26, 1))
>Tagged : Symbol(Tagged, Decl(mixinClassesAnnotated.ts, 26, 1), Decl(mixinClassesAnnotated.ts, 22, 5))
>T : Symbol(T, Decl(mixinClassesAnnotated.ts, 28, 16))
>Constructor : Symbol(Constructor, Decl(mixinClassesAnnotated.ts, 0, 0))
>superClass : Symbol(superClass, Decl(mixinClassesAnnotated.ts, 28, 43))
>T : Symbol(T, Decl(mixinClassesAnnotated.ts, 28, 16))
>Constructor : Symbol(Constructor, Decl(mixinClassesAnnotated.ts, 0, 0))
>Tagged : Symbol(Tagged, Decl(mixinClassesAnnotated.ts, 22, 5), Decl(mixinClassesAnnotated.ts, 26, 1))
>Tagged : Symbol(Tagged, Decl(mixinClassesAnnotated.ts, 26, 1), Decl(mixinClassesAnnotated.ts, 22, 5))
>T : Symbol(T, Decl(mixinClassesAnnotated.ts, 28, 16))
class C extends superClass {
@ -111,12 +111,12 @@ function Tagged<T extends Constructor<{}>>(superClass: T): Constructor<Tagged> &
const Thing1 = Tagged(Derived);
>Thing1 : Symbol(Thing1, Decl(mixinClassesAnnotated.ts, 39, 5))
>Tagged : Symbol(Tagged, Decl(mixinClassesAnnotated.ts, 22, 5), Decl(mixinClassesAnnotated.ts, 26, 1))
>Tagged : Symbol(Tagged, Decl(mixinClassesAnnotated.ts, 26, 1), Decl(mixinClassesAnnotated.ts, 22, 5))
>Derived : Symbol(Derived, Decl(mixinClassesAnnotated.ts, 4, 1))
const Thing2 = Tagged(Printable(Derived));
>Thing2 : Symbol(Thing2, Decl(mixinClassesAnnotated.ts, 40, 5))
>Tagged : Symbol(Tagged, Decl(mixinClassesAnnotated.ts, 22, 5), Decl(mixinClassesAnnotated.ts, 26, 1))
>Tagged : Symbol(Tagged, Decl(mixinClassesAnnotated.ts, 26, 1), Decl(mixinClassesAnnotated.ts, 22, 5))
>Printable : Symbol(Printable, Decl(mixinClassesAnnotated.ts, 10, 1), Decl(mixinClassesAnnotated.ts, 16, 5))
>Derived : Symbol(Derived, Decl(mixinClassesAnnotated.ts, 4, 1))

View File

@ -3,13 +3,13 @@ module A {
>A : Symbol(A, Decl(mixingFunctionAndAmbientModule1.ts, 0, 0))
declare module My {
>My : Symbol(My, Decl(mixingFunctionAndAmbientModule1.ts, 0, 10), Decl(mixingFunctionAndAmbientModule1.ts, 3, 5))
>My : Symbol(My, Decl(mixingFunctionAndAmbientModule1.ts, 3, 5), Decl(mixingFunctionAndAmbientModule1.ts, 0, 10))
export var x: number;
>x : Symbol(x, Decl(mixingFunctionAndAmbientModule1.ts, 2, 18))
}
function My(s: string) { }
>My : Symbol(My, Decl(mixingFunctionAndAmbientModule1.ts, 0, 10), Decl(mixingFunctionAndAmbientModule1.ts, 3, 5))
>My : Symbol(My, Decl(mixingFunctionAndAmbientModule1.ts, 3, 5), Decl(mixingFunctionAndAmbientModule1.ts, 0, 10))
>s : Symbol(s, Decl(mixingFunctionAndAmbientModule1.ts, 4, 16))
}
@ -17,17 +17,17 @@ module B {
>B : Symbol(B, Decl(mixingFunctionAndAmbientModule1.ts, 5, 1))
declare module My {
>My : Symbol(My, Decl(mixingFunctionAndAmbientModule1.ts, 7, 10), Decl(mixingFunctionAndAmbientModule1.ts, 10, 5), Decl(mixingFunctionAndAmbientModule1.ts, 11, 28))
>My : Symbol(My, Decl(mixingFunctionAndAmbientModule1.ts, 10, 5), Decl(mixingFunctionAndAmbientModule1.ts, 11, 28), Decl(mixingFunctionAndAmbientModule1.ts, 7, 10))
export var x: number;
>x : Symbol(x, Decl(mixingFunctionAndAmbientModule1.ts, 9, 18))
}
function My(s: boolean);
>My : Symbol(My, Decl(mixingFunctionAndAmbientModule1.ts, 7, 10), Decl(mixingFunctionAndAmbientModule1.ts, 10, 5), Decl(mixingFunctionAndAmbientModule1.ts, 11, 28))
>My : Symbol(My, Decl(mixingFunctionAndAmbientModule1.ts, 10, 5), Decl(mixingFunctionAndAmbientModule1.ts, 11, 28), Decl(mixingFunctionAndAmbientModule1.ts, 7, 10))
>s : Symbol(s, Decl(mixingFunctionAndAmbientModule1.ts, 11, 16))
function My(s: any) { }
>My : Symbol(My, Decl(mixingFunctionAndAmbientModule1.ts, 7, 10), Decl(mixingFunctionAndAmbientModule1.ts, 10, 5), Decl(mixingFunctionAndAmbientModule1.ts, 11, 28))
>My : Symbol(My, Decl(mixingFunctionAndAmbientModule1.ts, 10, 5), Decl(mixingFunctionAndAmbientModule1.ts, 11, 28), Decl(mixingFunctionAndAmbientModule1.ts, 7, 10))
>s : Symbol(s, Decl(mixingFunctionAndAmbientModule1.ts, 12, 16))
}
@ -35,13 +35,13 @@ module C {
>C : Symbol(C, Decl(mixingFunctionAndAmbientModule1.ts, 13, 1))
declare module My {
>My : Symbol(My, Decl(mixingFunctionAndAmbientModule1.ts, 15, 10), Decl(mixingFunctionAndAmbientModule1.ts, 18, 5))
>My : Symbol(My, Decl(mixingFunctionAndAmbientModule1.ts, 18, 5), Decl(mixingFunctionAndAmbientModule1.ts, 15, 10))
export var x: number;
>x : Symbol(x, Decl(mixingFunctionAndAmbientModule1.ts, 17, 18))
}
declare function My(s: boolean);
>My : Symbol(My, Decl(mixingFunctionAndAmbientModule1.ts, 15, 10), Decl(mixingFunctionAndAmbientModule1.ts, 18, 5))
>My : Symbol(My, Decl(mixingFunctionAndAmbientModule1.ts, 18, 5), Decl(mixingFunctionAndAmbientModule1.ts, 15, 10))
>s : Symbol(s, Decl(mixingFunctionAndAmbientModule1.ts, 19, 24))
}
@ -49,17 +49,17 @@ module D {
>D : Symbol(D, Decl(mixingFunctionAndAmbientModule1.ts, 20, 1))
declare module My {
>My : Symbol(My, Decl(mixingFunctionAndAmbientModule1.ts, 22, 10), Decl(mixingFunctionAndAmbientModule1.ts, 25, 5), Decl(mixingFunctionAndAmbientModule1.ts, 26, 36))
>My : Symbol(My, Decl(mixingFunctionAndAmbientModule1.ts, 25, 5), Decl(mixingFunctionAndAmbientModule1.ts, 26, 36), Decl(mixingFunctionAndAmbientModule1.ts, 22, 10))
export var x: number;
>x : Symbol(x, Decl(mixingFunctionAndAmbientModule1.ts, 24, 18))
}
declare function My(s: boolean);
>My : Symbol(My, Decl(mixingFunctionAndAmbientModule1.ts, 22, 10), Decl(mixingFunctionAndAmbientModule1.ts, 25, 5), Decl(mixingFunctionAndAmbientModule1.ts, 26, 36))
>My : Symbol(My, Decl(mixingFunctionAndAmbientModule1.ts, 25, 5), Decl(mixingFunctionAndAmbientModule1.ts, 26, 36), Decl(mixingFunctionAndAmbientModule1.ts, 22, 10))
>s : Symbol(s, Decl(mixingFunctionAndAmbientModule1.ts, 26, 24))
declare function My(s: any);
>My : Symbol(My, Decl(mixingFunctionAndAmbientModule1.ts, 22, 10), Decl(mixingFunctionAndAmbientModule1.ts, 25, 5), Decl(mixingFunctionAndAmbientModule1.ts, 26, 36))
>My : Symbol(My, Decl(mixingFunctionAndAmbientModule1.ts, 25, 5), Decl(mixingFunctionAndAmbientModule1.ts, 26, 36), Decl(mixingFunctionAndAmbientModule1.ts, 22, 10))
>s : Symbol(s, Decl(mixingFunctionAndAmbientModule1.ts, 27, 24))
}
@ -68,23 +68,23 @@ module E {
>E : Symbol(E, Decl(mixingFunctionAndAmbientModule1.ts, 28, 1))
declare module My {
>My : Symbol(My, Decl(mixingFunctionAndAmbientModule1.ts, 31, 10), Decl(mixingFunctionAndAmbientModule1.ts, 34, 5), Decl(mixingFunctionAndAmbientModule1.ts, 35, 36), Decl(mixingFunctionAndAmbientModule1.ts, 38, 5))
>My : Symbol(My, Decl(mixingFunctionAndAmbientModule1.ts, 34, 5), Decl(mixingFunctionAndAmbientModule1.ts, 38, 5), Decl(mixingFunctionAndAmbientModule1.ts, 31, 10), Decl(mixingFunctionAndAmbientModule1.ts, 35, 36))
export var x: number;
>x : Symbol(x, Decl(mixingFunctionAndAmbientModule1.ts, 33, 18))
}
declare function My(s: boolean);
>My : Symbol(My, Decl(mixingFunctionAndAmbientModule1.ts, 31, 10), Decl(mixingFunctionAndAmbientModule1.ts, 34, 5), Decl(mixingFunctionAndAmbientModule1.ts, 35, 36), Decl(mixingFunctionAndAmbientModule1.ts, 38, 5))
>My : Symbol(My, Decl(mixingFunctionAndAmbientModule1.ts, 34, 5), Decl(mixingFunctionAndAmbientModule1.ts, 38, 5), Decl(mixingFunctionAndAmbientModule1.ts, 31, 10), Decl(mixingFunctionAndAmbientModule1.ts, 35, 36))
>s : Symbol(s, Decl(mixingFunctionAndAmbientModule1.ts, 35, 24))
declare module My {
>My : Symbol(My, Decl(mixingFunctionAndAmbientModule1.ts, 31, 10), Decl(mixingFunctionAndAmbientModule1.ts, 34, 5), Decl(mixingFunctionAndAmbientModule1.ts, 35, 36), Decl(mixingFunctionAndAmbientModule1.ts, 38, 5))
>My : Symbol(My, Decl(mixingFunctionAndAmbientModule1.ts, 34, 5), Decl(mixingFunctionAndAmbientModule1.ts, 38, 5), Decl(mixingFunctionAndAmbientModule1.ts, 31, 10), Decl(mixingFunctionAndAmbientModule1.ts, 35, 36))
export var y: number;
>y : Symbol(y, Decl(mixingFunctionAndAmbientModule1.ts, 37, 18))
}
declare function My(s: any);
>My : Symbol(My, Decl(mixingFunctionAndAmbientModule1.ts, 31, 10), Decl(mixingFunctionAndAmbientModule1.ts, 34, 5), Decl(mixingFunctionAndAmbientModule1.ts, 35, 36), Decl(mixingFunctionAndAmbientModule1.ts, 38, 5))
>My : Symbol(My, Decl(mixingFunctionAndAmbientModule1.ts, 34, 5), Decl(mixingFunctionAndAmbientModule1.ts, 38, 5), Decl(mixingFunctionAndAmbientModule1.ts, 31, 10), Decl(mixingFunctionAndAmbientModule1.ts, 35, 36))
>s : Symbol(s, Decl(mixingFunctionAndAmbientModule1.ts, 39, 24))
}

View File

@ -1,7 +1,6 @@
tests/cases/conformance/es6/modules/m1.ts(1,22): error TS2528: A module cannot have multiple default exports.
tests/cases/conformance/es6/modules/m1.ts(5,25): error TS2528: A module cannot have multiple default exports.
tests/cases/conformance/es6/modules/m1.ts(10,16): error TS2528: A module cannot have multiple default exports.
tests/cases/conformance/es6/modules/m2.ts(3,1): error TS2348: Value of type 'typeof foo' is not callable. Did you mean to include 'new'?
==== tests/cases/conformance/es6/modules/m1.ts (3 errors) ====
@ -22,9 +21,7 @@ tests/cases/conformance/es6/modules/m2.ts(3,1): error TS2348: Value of type 'typ
~
!!! error TS2528: A module cannot have multiple default exports.
==== tests/cases/conformance/es6/modules/m2.ts (1 errors) ====
==== tests/cases/conformance/es6/modules/m2.ts (0 errors) ====
import Entity from "./m1"
Entity();
~~~~~~~~
!!! error TS2348: Value of type 'typeof foo' is not callable. Did you mean to include 'new'?
Entity();

View File

@ -18,9 +18,9 @@ export default x;
=== tests/cases/conformance/es6/modules/m2.ts ===
import Entity from "./m1"
>Entity : typeof Entity
>Entity : () => void
Entity();
>Entity() : any
>Entity : typeof Entity
>Entity() : void
>Entity : () => void

View File

@ -1,17 +1,17 @@
tests/cases/compiler/nonMergedOverloads.ts(1,5): error TS2300: Duplicate identifier 'f'.
tests/cases/compiler/nonMergedOverloads.ts(3,17): error TS2300: Duplicate identifier 'f'.
tests/cases/compiler/nonMergedOverloads.ts(4,17): error TS2300: Duplicate identifier 'f'.
tests/cases/compiler/nonMergedOverloads.ts(1,5): error TS2395: Individual declarations in merged declaration 'f' must be all exported or all local.
tests/cases/compiler/nonMergedOverloads.ts(3,17): error TS2395: Individual declarations in merged declaration 'f' must be all exported or all local.
tests/cases/compiler/nonMergedOverloads.ts(4,17): error TS2395: Individual declarations in merged declaration 'f' must be all exported or all local.
==== tests/cases/compiler/nonMergedOverloads.ts (3 errors) ====
var f = 10;
~
!!! error TS2300: Duplicate identifier 'f'.
!!! error TS2395: Individual declarations in merged declaration 'f' must be all exported or all local.
export function f();
~
!!! error TS2300: Duplicate identifier 'f'.
!!! error TS2395: Individual declarations in merged declaration 'f' must be all exported or all local.
export function f() {
~
!!! error TS2300: Duplicate identifier 'f'.
!!! error TS2395: Individual declarations in merged declaration 'f' must be all exported or all local.
}

View File

@ -1,6 +1,6 @@
=== tests/cases/compiler/nonMergedOverloads.ts ===
var f = 10;
>f : Symbol(f, Decl(nonMergedOverloads.ts, 0, 3))
>f : Symbol(f, Decl(nonMergedOverloads.ts, 0, 11), Decl(nonMergedOverloads.ts, 2, 20), Decl(nonMergedOverloads.ts, 0, 3))
export function f();
>f : Symbol(f, Decl(nonMergedOverloads.ts, 0, 11), Decl(nonMergedOverloads.ts, 2, 20))

View File

@ -1,10 +1,10 @@
=== tests/cases/compiler/partiallyAmbientFundule.ts ===
declare module foo {
>foo : Symbol(foo, Decl(partiallyAmbientFundule.ts, 0, 0), Decl(partiallyAmbientFundule.ts, 2, 1))
>foo : Symbol(foo, Decl(partiallyAmbientFundule.ts, 2, 1), Decl(partiallyAmbientFundule.ts, 0, 0))
export function x(): any;
>x : Symbol(x, Decl(partiallyAmbientFundule.ts, 0, 20))
}
function foo () { } // Legal, because module is ambient
>foo : Symbol(foo, Decl(partiallyAmbientFundule.ts, 0, 0), Decl(partiallyAmbientFundule.ts, 2, 1))
>foo : Symbol(foo, Decl(partiallyAmbientFundule.ts, 2, 1), Decl(partiallyAmbientFundule.ts, 0, 0))

View File

@ -1,18 +1,18 @@
=== tests/cases/compiler/privacyCheckExportAssignmentOnExportedGenericInterface2.ts ===
export = Foo;
>Foo : Symbol(Foo, Decl(privacyCheckExportAssignmentOnExportedGenericInterface2.ts, 0, 13), Decl(privacyCheckExportAssignmentOnExportedGenericInterface2.ts, 3, 1), Decl(privacyCheckExportAssignmentOnExportedGenericInterface2.ts, 7, 1))
>Foo : Symbol(Foo, Decl(privacyCheckExportAssignmentOnExportedGenericInterface2.ts, 3, 1), Decl(privacyCheckExportAssignmentOnExportedGenericInterface2.ts, 0, 13), Decl(privacyCheckExportAssignmentOnExportedGenericInterface2.ts, 7, 1))
interface Foo<T> {
>Foo : Symbol(Foo, Decl(privacyCheckExportAssignmentOnExportedGenericInterface2.ts, 0, 13), Decl(privacyCheckExportAssignmentOnExportedGenericInterface2.ts, 3, 1), Decl(privacyCheckExportAssignmentOnExportedGenericInterface2.ts, 7, 1))
>Foo : Symbol(Foo, Decl(privacyCheckExportAssignmentOnExportedGenericInterface2.ts, 3, 1), Decl(privacyCheckExportAssignmentOnExportedGenericInterface2.ts, 0, 13), Decl(privacyCheckExportAssignmentOnExportedGenericInterface2.ts, 7, 1))
>T : Symbol(T, Decl(privacyCheckExportAssignmentOnExportedGenericInterface2.ts, 2, 14))
}
function Foo<T>(array: T[]): Foo<T> {
>Foo : Symbol(Foo, Decl(privacyCheckExportAssignmentOnExportedGenericInterface2.ts, 0, 13), Decl(privacyCheckExportAssignmentOnExportedGenericInterface2.ts, 3, 1), Decl(privacyCheckExportAssignmentOnExportedGenericInterface2.ts, 7, 1))
>Foo : Symbol(Foo, Decl(privacyCheckExportAssignmentOnExportedGenericInterface2.ts, 3, 1), Decl(privacyCheckExportAssignmentOnExportedGenericInterface2.ts, 0, 13), Decl(privacyCheckExportAssignmentOnExportedGenericInterface2.ts, 7, 1))
>T : Symbol(T, Decl(privacyCheckExportAssignmentOnExportedGenericInterface2.ts, 5, 13))
>array : Symbol(array, Decl(privacyCheckExportAssignmentOnExportedGenericInterface2.ts, 5, 16))
>T : Symbol(T, Decl(privacyCheckExportAssignmentOnExportedGenericInterface2.ts, 5, 13))
>Foo : Symbol(Foo, Decl(privacyCheckExportAssignmentOnExportedGenericInterface2.ts, 0, 13), Decl(privacyCheckExportAssignmentOnExportedGenericInterface2.ts, 3, 1), Decl(privacyCheckExportAssignmentOnExportedGenericInterface2.ts, 7, 1))
>Foo : Symbol(Foo, Decl(privacyCheckExportAssignmentOnExportedGenericInterface2.ts, 3, 1), Decl(privacyCheckExportAssignmentOnExportedGenericInterface2.ts, 0, 13), Decl(privacyCheckExportAssignmentOnExportedGenericInterface2.ts, 7, 1))
>T : Symbol(T, Decl(privacyCheckExportAssignmentOnExportedGenericInterface2.ts, 5, 13))
return undefined;
@ -20,7 +20,7 @@ function Foo<T>(array: T[]): Foo<T> {
}
module Foo {
>Foo : Symbol(Foo, Decl(privacyCheckExportAssignmentOnExportedGenericInterface2.ts, 0, 13), Decl(privacyCheckExportAssignmentOnExportedGenericInterface2.ts, 3, 1), Decl(privacyCheckExportAssignmentOnExportedGenericInterface2.ts, 7, 1))
>Foo : Symbol(Foo, Decl(privacyCheckExportAssignmentOnExportedGenericInterface2.ts, 3, 1), Decl(privacyCheckExportAssignmentOnExportedGenericInterface2.ts, 0, 13), Decl(privacyCheckExportAssignmentOnExportedGenericInterface2.ts, 7, 1))
export var x = "hello";
>x : Symbol(x, Decl(privacyCheckExportAssignmentOnExportedGenericInterface2.ts, 10, 14))

View File

@ -1,11 +1,11 @@
=== tests/cases/compiler/reservedWords2.ts ===
import while = require("dfdf");
import * as while from "foo"
> : Symbol((Missing), Decl(reservedWords2.ts, 1, 6), Decl(reservedWords2.ts, 3, 16))
> : Symbol((Missing), Decl(reservedWords2.ts, 3, 16), Decl(reservedWords2.ts, 1, 6))
var typeof = 10;
function throw() {}
> : Symbol((Missing), Decl(reservedWords2.ts, 1, 6), Decl(reservedWords2.ts, 3, 16))
> : Symbol((Missing), Decl(reservedWords2.ts, 3, 16), Decl(reservedWords2.ts, 1, 6))
module void {}
var {while, return} = { while: 1, return: 2 };

View File

@ -1,11 +1,14 @@
tests/cases/compiler/targetTypeTest1.ts(1,15): error TS2300: Duplicate identifier 'Point'.
tests/cases/compiler/targetTypeTest1.ts(6,43): error TS2304: Cannot find name 'Point'.
tests/cases/compiler/targetTypeTest1.ts(7,22): error TS2304: Cannot find name 'Point'.
tests/cases/compiler/targetTypeTest1.ts(14,10): error TS2300: Duplicate identifier 'Point'.
tests/cases/compiler/targetTypeTest1.ts(19,18): error TS2384: Overload signatures must all be ambient or non-ambient.
tests/cases/compiler/targetTypeTest1.ts(26,7): error TS2339: Property 'origin' does not exist on type '(x: any, y: any) => void'.
tests/cases/compiler/targetTypeTest1.ts(53,15): error TS2300: Duplicate identifier 'C'.
tests/cases/compiler/targetTypeTest1.ts(60,10): error TS2300: Duplicate identifier 'C'.
==== tests/cases/compiler/targetTypeTest1.ts (5 errors) ====
==== tests/cases/compiler/targetTypeTest1.ts (8 errors) ====
declare class Point
~~~~~
!!! error TS2300: Duplicate identifier 'Point'.
@ -14,7 +17,11 @@ tests/cases/compiler/targetTypeTest1.ts(60,10): error TS2300: Duplicate identifi
public x: number;
public y: number;
public add(dx: number, dy: number): Point;
~~~~~
!!! error TS2304: Cannot find name 'Point'.
static origin: Point;
~~~~~
!!! error TS2304: Cannot find name 'Point'.
}
@ -38,6 +45,8 @@ tests/cases/compiler/targetTypeTest1.ts(60,10): error TS2300: Duplicate identifi
// Point.origin declared as type Point
Point.origin = new Point(0, 0);
~~~~~~
!!! error TS2339: Property 'origin' does not exist on type '(x: any, y: any) => void'.
// Point.prototype declared as type Point
// this inferred as Point because of obj.prop assignment

View File

@ -16,11 +16,9 @@ declare class Point
>add : Symbol(Point.add, Decl(targetTypeTest1.ts, 4, 23))
>dx : Symbol(dx, Decl(targetTypeTest1.ts, 5, 17))
>dy : Symbol(dy, Decl(targetTypeTest1.ts, 5, 28))
>Point : Symbol(Point, Decl(targetTypeTest1.ts, 0, 0))
static origin: Point;
>origin : Symbol(Point.origin, Decl(targetTypeTest1.ts, 5, 48))
>Point : Symbol(Point, Decl(targetTypeTest1.ts, 0, 0))
}
@ -57,25 +55,21 @@ var x = EF1(1,2);
// Point.origin declared as type Point
Point.origin = new Point(0, 0);
>Point.origin : Symbol(Point.origin, Decl(targetTypeTest1.ts, 5, 48))
>Point : Symbol(Point, Decl(targetTypeTest1.ts, 0, 0))
>origin : Symbol(Point.origin, Decl(targetTypeTest1.ts, 5, 48))
>Point : Symbol(Point, Decl(targetTypeTest1.ts, 0, 0))
>Point : Symbol(Point, Decl(targetTypeTest1.ts, 8, 1))
>Point : Symbol(Point, Decl(targetTypeTest1.ts, 8, 1))
// Point.prototype declared as type Point
// this inferred as Point because of obj.prop assignment
// dx, dy, and return type inferred using target typing
Point.prototype.add = function(dx, dy) {
>Point.prototype.add : Symbol(Point.add, Decl(targetTypeTest1.ts, 4, 23))
>Point.prototype : Symbol(Point.prototype)
>Point : Symbol(Point, Decl(targetTypeTest1.ts, 0, 0))
>prototype : Symbol(Point.prototype)
>add : Symbol(Point.add, Decl(targetTypeTest1.ts, 4, 23))
>Point.prototype : Symbol(Function.prototype, Decl(lib.d.ts, --, --))
>Point : Symbol(Point, Decl(targetTypeTest1.ts, 8, 1))
>prototype : Symbol(Function.prototype, Decl(lib.d.ts, --, --))
>dx : Symbol(dx, Decl(targetTypeTest1.ts, 30, 31))
>dy : Symbol(dy, Decl(targetTypeTest1.ts, 30, 34))
return new Point(this.x + dx, this.y + dy);
>Point : Symbol(Point, Decl(targetTypeTest1.ts, 0, 0))
>Point : Symbol(Point, Decl(targetTypeTest1.ts, 8, 1))
>dx : Symbol(dx, Decl(targetTypeTest1.ts, 30, 31))
>dy : Symbol(dy, Decl(targetTypeTest1.ts, 30, 34))
@ -88,9 +82,9 @@ var f : number = 5;
// this in function add inferred to be type of object literal (i.e. Point)
// dx, dy, and return type of add inferred using target typing
Point.prototype = {
>Point.prototype : Symbol(Point.prototype)
>Point : Symbol(Point, Decl(targetTypeTest1.ts, 0, 0))
>prototype : Symbol(Point.prototype)
>Point.prototype : Symbol(Function.prototype, Decl(lib.d.ts, --, --))
>Point : Symbol(Point, Decl(targetTypeTest1.ts, 8, 1))
>prototype : Symbol(Function.prototype, Decl(lib.d.ts, --, --))
x: 0,
>x : Symbol(x, Decl(targetTypeTest1.ts, 39, 19))
@ -104,7 +98,7 @@ Point.prototype = {
>dy : Symbol(dy, Decl(targetTypeTest1.ts, 42, 21))
return new Point(this.x + dx, this.y + dy);
>Point : Symbol(Point, Decl(targetTypeTest1.ts, 0, 0))
>Point : Symbol(Point, Decl(targetTypeTest1.ts, 8, 1))
>dx : Symbol(dx, Decl(targetTypeTest1.ts, 42, 18))
>dy : Symbol(dy, Decl(targetTypeTest1.ts, 42, 21))
}
@ -153,9 +147,9 @@ function C(a,b) {
}
C.prototype =
>C.prototype : Symbol(C.prototype)
>C : Symbol(C, Decl(targetTypeTest1.ts, 50, 1))
>prototype : Symbol(C.prototype)
>C.prototype : Symbol(Function.prototype, Decl(lib.d.ts, --, --))
>C : Symbol(C, Decl(targetTypeTest1.ts, 57, 1))
>prototype : Symbol(Function.prototype, Decl(lib.d.ts, --, --))
{ a:0,
>a : Symbol(a, Decl(targetTypeTest1.ts, 65, 2))

View File

@ -13,14 +13,14 @@ declare class Point
>y : number
public add(dx: number, dy: number): Point;
>add : (dx: number, dy: number) => Point
>add : (dx: number, dy: number) => any
>dx : number
>dy : number
>Point : Point
>Point : No type information available!
static origin: Point;
>origin : Point
>Point : Point
>origin : any
>Point : No type information available!
}
@ -69,12 +69,12 @@ var x = EF1(1,2);
// Point.origin declared as type Point
Point.origin = new Point(0, 0);
>Point.origin = new Point(0, 0) : Point
>Point.origin : Point
>Point : typeof Point
>origin : Point
>new Point(0, 0) : Point
>Point : typeof Point
>Point.origin = new Point(0, 0) : any
>Point.origin : any
>Point : (x: any, y: any) => void
>origin : any
>new Point(0, 0) : any
>Point : (x: any, y: any) => void
>0 : 0
>0 : 0
@ -82,29 +82,29 @@ Point.origin = new Point(0, 0);
// this inferred as Point because of obj.prop assignment
// dx, dy, and return type inferred using target typing
Point.prototype.add = function(dx, dy) {
>Point.prototype.add = function(dx, dy) { return new Point(this.x + dx, this.y + dy);} : (dx: number, dy: number) => Point
>Point.prototype.add : (dx: number, dy: number) => Point
>Point.prototype : Point
>Point : typeof Point
>prototype : Point
>add : (dx: number, dy: number) => Point
>function(dx, dy) { return new Point(this.x + dx, this.y + dy);} : (dx: number, dy: number) => Point
>dx : number
>dy : number
>Point.prototype.add = function(dx, dy) { return new Point(this.x + dx, this.y + dy);} : (dx: any, dy: any) => any
>Point.prototype.add : any
>Point.prototype : any
>Point : (x: any, y: any) => void
>prototype : any
>add : any
>function(dx, dy) { return new Point(this.x + dx, this.y + dy);} : (dx: any, dy: any) => any
>dx : any
>dy : any
return new Point(this.x + dx, this.y + dy);
>new Point(this.x + dx, this.y + dy) : Point
>Point : typeof Point
>new Point(this.x + dx, this.y + dy) : any
>Point : (x: any, y: any) => void
>this.x + dx : any
>this.x : any
>this : any
>x : any
>dx : number
>dx : any
>this.y + dy : any
>this.y : any
>this : any
>y : any
>dy : number
>dy : any
};
@ -116,11 +116,11 @@ var f : number = 5;
// this in function add inferred to be type of object literal (i.e. Point)
// dx, dy, and return type of add inferred using target typing
Point.prototype = {
>Point.prototype = { x: 0, y: 0, add: function(dx, dy) { return new Point(this.x + dx, this.y + dy); }} : { x: number; y: number; add: (dx: number, dy: number) => Point; }
>Point.prototype : Point
>Point : typeof Point
>prototype : Point
>{ x: 0, y: 0, add: function(dx, dy) { return new Point(this.x + dx, this.y + dy); }} : { x: number; y: number; add: (dx: number, dy: number) => Point; }
>Point.prototype = { x: 0, y: 0, add: function(dx, dy) { return new Point(this.x + dx, this.y + dy); }} : { x: number; y: number; add: (dx: any, dy: any) => any; }
>Point.prototype : any
>Point : (x: any, y: any) => void
>prototype : any
>{ x: 0, y: 0, add: function(dx, dy) { return new Point(this.x + dx, this.y + dy); }} : { x: number; y: number; add: (dx: any, dy: any) => any; }
x: 0,
>x : number
@ -131,24 +131,24 @@ Point.prototype = {
>0 : 0
add: function(dx, dy) {
>add : (dx: number, dy: number) => Point
>function(dx, dy) { return new Point(this.x + dx, this.y + dy); } : (dx: number, dy: number) => Point
>dx : number
>dy : number
>add : (dx: any, dy: any) => any
>function(dx, dy) { return new Point(this.x + dx, this.y + dy); } : (dx: any, dy: any) => any
>dx : any
>dy : any
return new Point(this.x + dx, this.y + dy);
>new Point(this.x + dx, this.y + dy) : Point
>Point : typeof Point
>new Point(this.x + dx, this.y + dy) : any
>Point : (x: any, y: any) => void
>this.x + dx : any
>this.x : any
>this : any
>x : any
>dx : number
>dx : any
>this.y + dy : any
>this.y : any
>this : any
>y : any
>dy : number
>dy : any
}
};
@ -205,13 +205,13 @@ function C(a,b) {
}
C.prototype =
>C.prototype = { a:0, b:0, C1M1: function(c,d) { return (this.a + c) + (this.b + d); } } : { a: number; b: number; C1M1: (c: number, d: number) => any; }
>C.prototype : C
>C : typeof C
>prototype : C
>C.prototype = { a:0, b:0, C1M1: function(c,d) { return (this.a + c) + (this.b + d); } } : { a: number; b: number; C1M1: (c: any, d: any) => any; }
>C.prototype : any
>C : (a: any, b: any) => void
>prototype : any
{ a:0,
>{ a:0, b:0, C1M1: function(c,d) { return (this.a + c) + (this.b + d); } } : { a: number; b: number; C1M1: (c: number, d: number) => any; }
>{ a:0, b:0, C1M1: function(c,d) { return (this.a + c) + (this.b + d); } } : { a: number; b: number; C1M1: (c: any, d: any) => any; }
>a : number
>0 : 0
@ -220,10 +220,10 @@ C.prototype =
>0 : 0
C1M1: function(c,d) {
>C1M1 : (c: number, d: number) => any
>function(c,d) { return (this.a + c) + (this.b + d); } : (c: number, d: number) => any
>c : number
>d : number
>C1M1 : (c: any, d: any) => any
>function(c,d) { return (this.a + c) + (this.b + d); } : (c: any, d: any) => any
>c : any
>d : any
return (this.a + c) + (this.b + d);
>(this.a + c) + (this.b + d) : any
@ -232,13 +232,13 @@ C.prototype =
>this.a : any
>this : any
>a : any
>c : number
>c : any
>(this.b + d) : any
>this.b + d : any
>this.b : any
>this : any
>b : any
>d : number
>d : any
}
};

View File

@ -0,0 +1,84 @@
=== tests/cases/conformance/salsa/use.js ===
/// <reference path='./types.d.ts'/>
var mini = require('./minimatch')
>mini : Symbol(mini, Decl(use.js, 1, 3))
>require : Symbol(require, Decl(types.d.ts, 0, 11))
>'./minimatch' : Symbol("tests/cases/conformance/salsa/minimatch", Decl(minimatch.js, 0, 0))
mini.M.defaults()
>mini.M.defaults : Symbol(M.defaults, Decl(minimatch.js, 8, 1))
>mini.M : Symbol(minimatch.M, Decl(minimatch.js, 1, 26))
>mini : Symbol(mini, Decl(use.js, 1, 3))
>M : Symbol(minimatch.M, Decl(minimatch.js, 1, 26))
>defaults : Symbol(M.defaults, Decl(minimatch.js, 8, 1))
var m = new mini.M()
>m : Symbol(m, Decl(use.js, 3, 3))
>mini.M : Symbol(minimatch.M, Decl(minimatch.js, 1, 26))
>mini : Symbol(mini, Decl(use.js, 1, 3))
>M : Symbol(minimatch.M, Decl(minimatch.js, 1, 26))
m.m()
>m.m : Symbol(M.m, Decl(minimatch.js, 11, 1))
>m : Symbol(m, Decl(use.js, 3, 3))
>m : Symbol(M.m, Decl(minimatch.js, 11, 1))
mini.filter()
>mini.filter : Symbol(minimatch.filter, Decl(minimatch.js, 2, 15))
>mini : Symbol(mini, Decl(use.js, 1, 3))
>filter : Symbol(minimatch.filter, Decl(minimatch.js, 2, 15))
=== tests/cases/conformance/salsa/types.d.ts ===
declare var require: any;
>require : Symbol(require, Decl(types.d.ts, 0, 11))
declare var module: any;
>module : Symbol(module, Decl(types.d.ts, 1, 11))
=== tests/cases/conformance/salsa/minimatch.js ===
/// <reference path='./types.d.ts'/>
module.exports = minimatch
>module : Symbol(export=, Decl(minimatch.js, 0, 0))
>exports : Symbol(export=, Decl(minimatch.js, 0, 0))
>minimatch : Symbol(minimatch, Decl(minimatch.js, 6, 1))
minimatch.M = M
>minimatch.M : Symbol(minimatch.M, Decl(minimatch.js, 1, 26))
>minimatch : Symbol(minimatch, Decl(minimatch.js, 6, 1))
>M : Symbol(minimatch.M, Decl(minimatch.js, 1, 26))
>M : Symbol(M, Decl(minimatch.js, 13, 1), Decl(minimatch.js, 8, 1))
minimatch.filter = filter
>minimatch.filter : Symbol(minimatch.filter, Decl(minimatch.js, 2, 15))
>minimatch : Symbol(minimatch, Decl(minimatch.js, 6, 1))
>filter : Symbol(minimatch.filter, Decl(minimatch.js, 2, 15))
>filter : Symbol(filter, Decl(minimatch.js, 3, 25))
function filter() {
>filter : Symbol(filter, Decl(minimatch.js, 3, 25))
return minimatch()
>minimatch : Symbol(minimatch, Decl(minimatch.js, 6, 1))
}
function minimatch() {
>minimatch : Symbol(minimatch, Decl(minimatch.js, 6, 1))
}
M.defaults = function (def) {
>M.defaults : Symbol(M.defaults, Decl(minimatch.js, 8, 1))
>M : Symbol(M, Decl(minimatch.js, 13, 1), Decl(minimatch.js, 8, 1))
>defaults : Symbol(M.defaults, Decl(minimatch.js, 8, 1))
>def : Symbol(def, Decl(minimatch.js, 9, 23))
return def
>def : Symbol(def, Decl(minimatch.js, 9, 23))
}
M.prototype.m = function () {
>M.prototype : Symbol(M.m, Decl(minimatch.js, 11, 1))
>M : Symbol(M, Decl(minimatch.js, 13, 1), Decl(minimatch.js, 8, 1))
>prototype : Symbol(Function.prototype, Decl(lib.d.ts, --, --))
>m : Symbol(M.m, Decl(minimatch.js, 11, 1))
}
function M() {
>M : Symbol(M, Decl(minimatch.js, 13, 1), Decl(minimatch.js, 8, 1))
}

View File

@ -0,0 +1,99 @@
=== tests/cases/conformance/salsa/use.js ===
/// <reference path='./types.d.ts'/>
var mini = require('./minimatch')
>mini : { (): void; M: typeof M; filter: () => void; }
>require('./minimatch') : { (): void; M: typeof M; filter: () => void; }
>require : any
>'./minimatch' : "./minimatch"
mini.M.defaults()
>mini.M.defaults() : any
>mini.M.defaults : (def: any) => any
>mini.M : typeof M
>mini : { (): void; M: typeof M; filter: () => void; }
>M : typeof M
>defaults : (def: any) => any
var m = new mini.M()
>m : typeof M
>new mini.M() : typeof M
>mini.M : typeof M
>mini : { (): void; M: typeof M; filter: () => void; }
>M : typeof M
m.m()
>m.m() : void
>m.m : () => void
>m : typeof M
>m : () => void
mini.filter()
>mini.filter() : void
>mini.filter : () => void
>mini : { (): void; M: typeof M; filter: () => void; }
>filter : () => void
=== tests/cases/conformance/salsa/types.d.ts ===
declare var require: any;
>require : any
declare var module: any;
>module : any
=== tests/cases/conformance/salsa/minimatch.js ===
/// <reference path='./types.d.ts'/>
module.exports = minimatch
>module.exports = minimatch : { (): void; M: typeof M; filter: () => void; }
>module.exports : any
>module : any
>exports : any
>minimatch : { (): void; M: typeof M; filter: () => void; }
minimatch.M = M
>minimatch.M = M : typeof M
>minimatch.M : typeof M
>minimatch : { (): void; M: typeof M; filter: () => void; }
>M : typeof M
>M : typeof M
minimatch.filter = filter
>minimatch.filter = filter : () => void
>minimatch.filter : () => void
>minimatch : { (): void; M: typeof M; filter: () => void; }
>filter : () => void
>filter : () => void
function filter() {
>filter : () => void
return minimatch()
>minimatch() : void
>minimatch : { (): void; M: typeof M; filter: () => void; }
}
function minimatch() {
>minimatch : { (): void; M: typeof M; filter: () => void; }
}
M.defaults = function (def) {
>M.defaults = function (def) { return def} : (def: any) => any
>M.defaults : (def: any) => any
>M : typeof M
>defaults : (def: any) => any
>function (def) { return def} : (def: any) => any
>def : any
return def
>def : any
}
M.prototype.m = function () {
>M.prototype.m = function () {} : () => void
>M.prototype.m : any
>M.prototype : any
>M : typeof M
>prototype : any
>m : any
>function () {} : () => void
}
function M() {
>M : typeof M
}

View File

@ -0,0 +1,30 @@
=== tests/cases/conformance/salsa/a.js ===
var GLOBSTAR = m.GLOBSTAR = {}
>GLOBSTAR : Symbol(GLOBSTAR, Decl(a.js, 0, 3))
>m.GLOBSTAR : Symbol(m.GLOBSTAR, Decl(a.js, 0, 14))
>m : Symbol(m, Decl(a.js, 0, 30))
>GLOBSTAR : Symbol(m.GLOBSTAR, Decl(a.js, 0, 14))
function m() {
>m : Symbol(m, Decl(a.js, 0, 30))
}
GLOBSTAR.p = 1
>GLOBSTAR : Symbol(GLOBSTAR, Decl(a.js, 0, 3))
m.GLOBSTAR.q = 2
>m.GLOBSTAR.q : Symbol(q, Decl(a.js, 3, 14))
>m.GLOBSTAR : Symbol(m.GLOBSTAR, Decl(a.js, 0, 14))
>m : Symbol(m, Decl(a.js, 0, 30))
>GLOBSTAR : Symbol(m.GLOBSTAR, Decl(a.js, 0, 14))
>q : Symbol(q, Decl(a.js, 3, 14))
GLOBSTAR.q
>GLOBSTAR.q : Symbol(q, Decl(a.js, 3, 14))
>GLOBSTAR : Symbol(GLOBSTAR, Decl(a.js, 0, 3))
>q : Symbol(q, Decl(a.js, 3, 14))
m.GLOBSTAR.p
>m.GLOBSTAR : Symbol(m.GLOBSTAR, Decl(a.js, 0, 14))
>m : Symbol(m, Decl(a.js, 0, 30))
>GLOBSTAR : Symbol(m.GLOBSTAR, Decl(a.js, 0, 14))

View File

@ -0,0 +1,40 @@
=== tests/cases/conformance/salsa/a.js ===
var GLOBSTAR = m.GLOBSTAR = {}
>GLOBSTAR : { [x: string]: any; q: number; }
>m.GLOBSTAR = {} : { [x: string]: any; q: number; }
>m.GLOBSTAR : { [x: string]: any; q: number; }
>m : { (): void; GLOBSTAR: { [x: string]: any; q: number; }; }
>GLOBSTAR : { [x: string]: any; q: number; }
>{} : { [x: string]: any; q: number; }
function m() {
>m : { (): void; GLOBSTAR: { [x: string]: any; q: number; }; }
}
GLOBSTAR.p = 1
>GLOBSTAR.p = 1 : 1
>GLOBSTAR.p : any
>GLOBSTAR : { [x: string]: any; q: number; }
>p : any
>1 : 1
m.GLOBSTAR.q = 2
>m.GLOBSTAR.q = 2 : 2
>m.GLOBSTAR.q : number
>m.GLOBSTAR : { [x: string]: any; q: number; }
>m : { (): void; GLOBSTAR: { [x: string]: any; q: number; }; }
>GLOBSTAR : { [x: string]: any; q: number; }
>q : number
>2 : 2
GLOBSTAR.q
>GLOBSTAR.q : number
>GLOBSTAR : { [x: string]: any; q: number; }
>q : number
m.GLOBSTAR.p
>m.GLOBSTAR.p : any
>m.GLOBSTAR : { [x: string]: any; q: number; }
>m : { (): void; GLOBSTAR: { [x: string]: any; q: number; }; }
>GLOBSTAR : { [x: string]: any; q: number; }
>p : any

View File

@ -0,0 +1,20 @@
tests/cases/conformance/salsa/semver.js(2,1): error TS2539: Cannot assign to '"tests/cases/conformance/salsa/semver"' because it is not a variable.
==== tests/cases/conformance/salsa/index.js (0 errors) ====
/// <reference path='./types.d.ts'/>
const C = require("./semver")
var two = C.f(1)
==== tests/cases/conformance/salsa/types.d.ts (0 errors) ====
declare var require: any;
declare var module: any;
==== tests/cases/conformance/salsa/semver.js (1 errors) ====
/// <reference path='./types.d.ts'/>
exports = module.exports = C
~~~~~~~
!!! error TS2539: Cannot assign to '"tests/cases/conformance/salsa/semver"' because it is not a variable.
C.f = n => n + 1
function C() {
this.p = 1
}

View File

@ -0,0 +1,41 @@
=== tests/cases/conformance/salsa/index.js ===
/// <reference path='./types.d.ts'/>
const C = require("./semver")
>C : Symbol(C, Decl(index.js, 1, 5))
>require : Symbol(require, Decl(types.d.ts, 0, 11))
>"./semver" : Symbol("tests/cases/conformance/salsa/semver", Decl(semver.js, 0, 0))
var two = C.f(1)
>two : Symbol(two, Decl(index.js, 2, 3))
>C.f : Symbol(C.f, Decl(semver.js, 1, 28))
>C : Symbol(C, Decl(index.js, 1, 5))
>f : Symbol(C.f, Decl(semver.js, 1, 28))
=== tests/cases/conformance/salsa/types.d.ts ===
declare var require: any;
>require : Symbol(require, Decl(types.d.ts, 0, 11))
declare var module: any;
>module : Symbol(module, Decl(types.d.ts, 1, 11))
=== tests/cases/conformance/salsa/semver.js ===
/// <reference path='./types.d.ts'/>
exports = module.exports = C
>exports : Symbol("tests/cases/conformance/salsa/semver", Decl(semver.js, 0, 0))
>module : Symbol(export=, Decl(semver.js, 1, 9))
>exports : Symbol(export=, Decl(semver.js, 1, 9))
>C : Symbol(C, Decl(semver.js, 2, 16))
C.f = n => n + 1
>C.f : Symbol(C.f, Decl(semver.js, 1, 28))
>C : Symbol(C, Decl(semver.js, 2, 16))
>f : Symbol(C.f, Decl(semver.js, 1, 28))
>n : Symbol(n, Decl(semver.js, 2, 5))
>n : Symbol(n, Decl(semver.js, 2, 5))
function C() {
>C : Symbol(C, Decl(semver.js, 2, 16))
this.p = 1
>p : Symbol(C.p, Decl(semver.js, 3, 14))
}

View File

@ -0,0 +1,55 @@
=== tests/cases/conformance/salsa/index.js ===
/// <reference path='./types.d.ts'/>
const C = require("./semver")
>C : { (): void; f: (n: any) => any; }
>require("./semver") : { (): void; f: (n: any) => any; }
>require : any
>"./semver" : "./semver"
var two = C.f(1)
>two : any
>C.f(1) : any
>C.f : (n: any) => any
>C : { (): void; f: (n: any) => any; }
>f : (n: any) => any
>1 : 1
=== tests/cases/conformance/salsa/types.d.ts ===
declare var require: any;
>require : any
declare var module: any;
>module : any
=== tests/cases/conformance/salsa/semver.js ===
/// <reference path='./types.d.ts'/>
exports = module.exports = C
>exports = module.exports = C : { (): void; f: (n: any) => any; }
>exports : any
>module.exports = C : { (): void; f: (n: any) => any; }
>module.exports : any
>module : any
>exports : any
>C : { (): void; f: (n: any) => any; }
C.f = n => n + 1
>C.f = n => n + 1 : (n: any) => any
>C.f : (n: any) => any
>C : { (): void; f: (n: any) => any; }
>f : (n: any) => any
>n => n + 1 : (n: any) => any
>n : any
>n + 1 : any
>n : any
>1 : 1
function C() {
>C : { (): void; f: (n: any) => any; }
this.p = 1
>this.p = 1 : 1
>this.p : any
>this : any
>p : any
>1 : 1
}

View File

@ -205,13 +205,6 @@ declare class Point
}
function Point(x, y) {
this.x = x;
this.y = y;
return this;
}
Point.origin = new Point(0, 0);
Point.prototype.add = function(dx, dy) {

View File

@ -0,0 +1,10 @@
// @allowJs: true
// @checkJs: true
// @noEmit: true
// @filename: a.js
OOOrder.prototype.m = function () {
this.p = 1
}
function OOOrder() {
this.x = 1
}

View File

@ -0,0 +1,31 @@
// @noEmit: true
// @allowJs: true
// @checkJs: true
// @Filename: types.d.ts
declare var require: any;
declare var module: any;
// @Filename: minimatch.js
/// <reference path='./types.d.ts'/>
module.exports = minimatch
minimatch.M = M
minimatch.filter = filter
function filter() {
return minimatch()
}
function minimatch() {
}
M.defaults = function (def) {
return def
}
M.prototype.m = function () {
}
function M() {
}
// @Filename: use.js
/// <reference path='./types.d.ts'/>
var mini = require('./minimatch')
mini.M.defaults()
var m = new mini.M()
m.m()
mini.filter()

View File

@ -0,0 +1,12 @@
// @noEmit: true
// @allowJs: true
// @checkJs: true
// @Filename: a.js
var GLOBSTAR = m.GLOBSTAR = {}
function m() {
}
GLOBSTAR.p = 1
m.GLOBSTAR.q = 2
GLOBSTAR.q
m.GLOBSTAR.p

View File

@ -0,0 +1,17 @@
// @allowJs: true
// @checkJs: true
// @noEmit: true
// @Filename: types.d.ts
declare var require: any;
declare var module: any;
// @Filename: semver.js
/// <reference path='./types.d.ts'/>
exports = module.exports = C
C.f = n => n + 1
function C() {
this.p = 1
}
// @filename: index.js
/// <reference path='./types.d.ts'/>
const C = require("./semver")
var two = C.f(1)

View File

@ -14,15 +14,15 @@
//// Alias/*2*/;
verify.quickInfoAt("1", [
"(alias) function Original(): void",
"(alias) type Original<T> = () => T",
"(alias) namespace Original",
"(alias) function Original(): void",
"import Original",
].join("\n"), "some docs ");
verify.quickInfoAt("2", [
"(alias) function Alias(): void",
"(alias) type Alias<T> = () => T",
"(alias) namespace Alias",
"(alias) function Alias(): void",
"import Alias",
].join("\n"), "some docs ");

View File

@ -12,7 +12,7 @@
////[|alias|].call(this); // value
verify.singleReferenceGroup([
"(alias) namespace alias",
"(alias) function alias(): void",
"(alias) namespace alias",
"import alias = ATest"
].join("\n"));