merge with master

This commit is contained in:
Vladimir Matveev
2015-06-04 10:57:34 -07:00
69 changed files with 2506 additions and 1865 deletions

View File

@@ -1,11 +1,8 @@
tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArrowFunctions/ArrowFunction3.ts(1,13): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement.
tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArrowFunctions/ArrowFunction3.ts(1,14): error TS1110: Type expected.
==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArrowFunctions/ArrowFunction3.ts (2 errors) ====
==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArrowFunctions/ArrowFunction3.ts (1 errors) ====
var v = (a): => {
!!! error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement.
~~
!!! error TS1110: Type expected.

View File

@@ -1,5 +1,11 @@
tests/cases/compiler/contextualTyping.ts(189,18): error TS2384: Overload signatures must all be ambient or non-ambient.\ntests/cases/compiler/contextualTyping.ts(197,15): error TS2300: Duplicate identifier 'Point'.\ntests/cases/compiler/contextualTyping.ts(207,10): error TS2300: Duplicate identifier 'Point'.\ntests/cases/compiler/contextualTyping.ts(230,5): error TS2322: Type '{}' is not assignable to type 'B'.
Property 'x' is missing in type '{}'.\n\n\n==== tests/cases/compiler/contextualTyping.ts (4 errors) ====
tests/cases/compiler/contextualTyping.ts(189,18): error TS2384: Overload signatures must all be ambient or non-ambient.
tests/cases/compiler/contextualTyping.ts(197,15): error TS2300: Duplicate identifier 'Point'.
tests/cases/compiler/contextualTyping.ts(207,10): error TS2300: Duplicate identifier 'Point'.
tests/cases/compiler/contextualTyping.ts(230,5): error TS2322: Type '{}' is not assignable to type 'B'.
Property 'x' is missing in type '{}'.
==== tests/cases/compiler/contextualTyping.ts (4 errors) ====
// DEFAULT INTERFACES
interface IFoo {
n: number;

View File

@@ -0,0 +1,37 @@
//// [cyclicGenericTypeInstantiation.ts]
function foo<T>() {
var z = foo<typeof y>();
var y: {
y2: typeof z
};
return y;
}
function bar<T>() {
var z = bar<typeof y>();
var y: {
y2: typeof z;
}
return y;
}
var a = foo<number>();
var b = bar<number>();
a = b;
//// [cyclicGenericTypeInstantiation.js]
function foo() {
var z = foo();
var y;
return y;
}
function bar() {
var z = bar();
var y;
return y;
}
var a = foo();
var b = bar();
a = b;

View File

@@ -0,0 +1,55 @@
=== tests/cases/compiler/cyclicGenericTypeInstantiation.ts ===
function foo<T>() {
>foo : Symbol(foo, Decl(cyclicGenericTypeInstantiation.ts, 0, 0))
>T : Symbol(T, Decl(cyclicGenericTypeInstantiation.ts, 0, 13))
var z = foo<typeof y>();
>z : Symbol(z, Decl(cyclicGenericTypeInstantiation.ts, 1, 7))
>foo : Symbol(foo, Decl(cyclicGenericTypeInstantiation.ts, 0, 0))
>y : Symbol(y, Decl(cyclicGenericTypeInstantiation.ts, 2, 7))
var y: {
>y : Symbol(y, Decl(cyclicGenericTypeInstantiation.ts, 2, 7))
y2: typeof z
>y2 : Symbol(y2, Decl(cyclicGenericTypeInstantiation.ts, 2, 12))
>z : Symbol(z, Decl(cyclicGenericTypeInstantiation.ts, 1, 7))
};
return y;
>y : Symbol(y, Decl(cyclicGenericTypeInstantiation.ts, 2, 7))
}
function bar<T>() {
>bar : Symbol(bar, Decl(cyclicGenericTypeInstantiation.ts, 6, 1))
>T : Symbol(T, Decl(cyclicGenericTypeInstantiation.ts, 9, 13))
var z = bar<typeof y>();
>z : Symbol(z, Decl(cyclicGenericTypeInstantiation.ts, 10, 7))
>bar : Symbol(bar, Decl(cyclicGenericTypeInstantiation.ts, 6, 1))
>y : Symbol(y, Decl(cyclicGenericTypeInstantiation.ts, 11, 7))
var y: {
>y : Symbol(y, Decl(cyclicGenericTypeInstantiation.ts, 11, 7))
y2: typeof z;
>y2 : Symbol(y2, Decl(cyclicGenericTypeInstantiation.ts, 11, 12))
>z : Symbol(z, Decl(cyclicGenericTypeInstantiation.ts, 10, 7))
}
return y;
>y : Symbol(y, Decl(cyclicGenericTypeInstantiation.ts, 11, 7))
}
var a = foo<number>();
>a : Symbol(a, Decl(cyclicGenericTypeInstantiation.ts, 17, 3))
>foo : Symbol(foo, Decl(cyclicGenericTypeInstantiation.ts, 0, 0))
var b = bar<number>();
>b : Symbol(b, Decl(cyclicGenericTypeInstantiation.ts, 18, 3))
>bar : Symbol(bar, Decl(cyclicGenericTypeInstantiation.ts, 6, 1))
a = b;
>a : Symbol(a, Decl(cyclicGenericTypeInstantiation.ts, 17, 3))
>b : Symbol(b, Decl(cyclicGenericTypeInstantiation.ts, 18, 3))

View File

@@ -0,0 +1,60 @@
=== tests/cases/compiler/cyclicGenericTypeInstantiation.ts ===
function foo<T>() {
>foo : <T>() => { y2: any; }
>T : T
var z = foo<typeof y>();
>z : { y2: any; }
>foo<typeof y>() : { y2: any; }
>foo : <T>() => { y2: any; }
>y : { y2: any; }
var y: {
>y : { y2: any; }
y2: typeof z
>y2 : { y2: any; }
>z : { y2: any; }
};
return y;
>y : { y2: any; }
}
function bar<T>() {
>bar : <T>() => { y2: any; }
>T : T
var z = bar<typeof y>();
>z : { y2: any; }
>bar<typeof y>() : { y2: any; }
>bar : <T>() => { y2: any; }
>y : { y2: any; }
var y: {
>y : { y2: any; }
y2: typeof z;
>y2 : { y2: any; }
>z : { y2: any; }
}
return y;
>y : { y2: any; }
}
var a = foo<number>();
>a : { y2: any; }
>foo<number>() : { y2: any; }
>foo : <T>() => { y2: any; }
var b = bar<number>();
>b : { y2: any; }
>bar<number>() : { y2: any; }
>bar : <T>() => { y2: any; }
a = b;
>a = b : { y2: any; }
>a : { y2: any; }
>b : { y2: any; }

View File

@@ -0,0 +1,7 @@
tests/cases/conformance/es6/destructuring/destructuringTypeAssertionsES5_1.ts(1,18): error TS2304: Cannot find name 'foo'.
==== tests/cases/conformance/es6/destructuring/destructuringTypeAssertionsES5_1.ts (1 errors) ====
var { x } = <any>foo();
~~~
!!! error TS2304: Cannot find name 'foo'.

View File

@@ -0,0 +1,5 @@
//// [destructuringTypeAssertionsES5_1.ts]
var { x } = <any>foo();
//// [destructuringTypeAssertionsES5_1.js]
var x = foo().x;

View File

@@ -0,0 +1,7 @@
tests/cases/conformance/es6/destructuring/destructuringTypeAssertionsES5_2.ts(1,19): error TS2304: Cannot find name 'foo'.
==== tests/cases/conformance/es6/destructuring/destructuringTypeAssertionsES5_2.ts (1 errors) ====
var { x } = (<any>foo());
~~~
!!! error TS2304: Cannot find name 'foo'.

View File

@@ -0,0 +1,5 @@
//// [destructuringTypeAssertionsES5_2.ts]
var { x } = (<any>foo());
//// [destructuringTypeAssertionsES5_2.js]
var x = foo().x;

View File

@@ -0,0 +1,7 @@
tests/cases/conformance/es6/destructuring/destructuringTypeAssertionsES5_3.ts(1,19): error TS2304: Cannot find name 'foo'.
==== tests/cases/conformance/es6/destructuring/destructuringTypeAssertionsES5_3.ts (1 errors) ====
var { x } = <any>(foo());
~~~
!!! error TS2304: Cannot find name 'foo'.

View File

@@ -0,0 +1,5 @@
//// [destructuringTypeAssertionsES5_3.ts]
var { x } = <any>(foo());
//// [destructuringTypeAssertionsES5_3.js]
var x = (foo()).x;

View File

@@ -0,0 +1,7 @@
tests/cases/conformance/es6/destructuring/destructuringTypeAssertionsES5_4.ts(1,23): error TS2304: Cannot find name 'foo'.
==== tests/cases/conformance/es6/destructuring/destructuringTypeAssertionsES5_4.ts (1 errors) ====
var { x } = <any><any>foo();
~~~
!!! error TS2304: Cannot find name 'foo'.

View File

@@ -0,0 +1,5 @@
//// [destructuringTypeAssertionsES5_4.ts]
var { x } = <any><any>foo();
//// [destructuringTypeAssertionsES5_4.js]
var x = foo().x;

View File

@@ -0,0 +1,5 @@
//// [destructuringTypeAssertionsES5_5.ts]
var { x } = <any>0;
//// [destructuringTypeAssertionsES5_5.js]
var x = (0).x;

View File

@@ -0,0 +1,4 @@
=== tests/cases/conformance/es6/destructuring/destructuringTypeAssertionsES5_5.ts ===
var { x } = <any>0;
>x : Symbol(x, Decl(destructuringTypeAssertionsES5_5.ts, 0, 5))

View File

@@ -0,0 +1,6 @@
=== tests/cases/conformance/es6/destructuring/destructuringTypeAssertionsES5_5.ts ===
var { x } = <any>0;
>x : any
><any>0 : any
>0 : number

View File

@@ -0,0 +1,7 @@
tests/cases/conformance/es6/destructuring/destructuringTypeAssertionsES5_6.ts(1,22): error TS2304: Cannot find name 'Foo'.
==== tests/cases/conformance/es6/destructuring/destructuringTypeAssertionsES5_6.ts (1 errors) ====
var { x } = <any>new Foo;
~~~
!!! error TS2304: Cannot find name 'Foo'.

View File

@@ -0,0 +1,5 @@
//// [destructuringTypeAssertionsES5_6.ts]
var { x } = <any>new Foo;
//// [destructuringTypeAssertionsES5_6.js]
var x = (new Foo).x;

View File

@@ -0,0 +1,7 @@
tests/cases/conformance/es6/destructuring/destructuringTypeAssertionsES5_7.ts(1,27): error TS2304: Cannot find name 'Foo'.
==== tests/cases/conformance/es6/destructuring/destructuringTypeAssertionsES5_7.ts (1 errors) ====
var { x } = <any><any>new Foo;
~~~
!!! error TS2304: Cannot find name 'Foo'.

View File

@@ -0,0 +1,5 @@
//// [destructuringTypeAssertionsES5_7.ts]
var { x } = <any><any>new Foo;
//// [destructuringTypeAssertionsES5_7.js]
var x = (new Foo).x;

View File

@@ -1,5 +1,4 @@
tests/cases/compiler/genericRecursiveImplicitConstructorErrors3.ts(3,66): error TS2314: Generic type 'MemberName<A, B, C>' requires 3 type argument(s).
tests/cases/compiler/genericRecursiveImplicitConstructorErrors3.ts(3,66): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement.
tests/cases/compiler/genericRecursiveImplicitConstructorErrors3.ts(10,22): error TS2314: Generic type 'PullTypeSymbol<A, B, C>' requires 3 type argument(s).
tests/cases/compiler/genericRecursiveImplicitConstructorErrors3.ts(12,48): error TS2314: Generic type 'PullSymbol<A, B, C>' requires 3 type argument(s).
tests/cases/compiler/genericRecursiveImplicitConstructorErrors3.ts(13,31): error TS2314: Generic type 'PullTypeSymbol<A, B, C>' requires 3 type argument(s).
@@ -8,14 +7,12 @@ tests/cases/compiler/genericRecursiveImplicitConstructorErrors3.ts(18,53): error
tests/cases/compiler/genericRecursiveImplicitConstructorErrors3.ts(19,22): error TS2339: Property 'isArray' does not exist on type 'PullTypeSymbol<A, B, C>'.
==== tests/cases/compiler/genericRecursiveImplicitConstructorErrors3.ts (8 errors) ====
==== tests/cases/compiler/genericRecursiveImplicitConstructorErrors3.ts (7 errors) ====
module TypeScript {
export class MemberName <A,B,C>{
static create<A,B,C>(arg1: any, arg2?: any, arg3?: any): MemberName {
~~~~~~~~~~
!!! error TS2314: Generic type 'MemberName<A, B, C>' requires 3 type argument(s).
~~~~~~~~~~
!!! error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement.
}
}
}

View File

@@ -1,12 +1,12 @@
error TS5050: Option 'mapRoot' cannot be specified with option 'inlineSourceMap'.
error TS5049: Option 'sourceRoot' cannot be specified with option 'inlineSourceMap'.
error TS5048: Option 'sourceMap' cannot be specified with option 'inlineSourceMap'.
error TS5049: Option 'sourceRoot' cannot be specified with option 'inlineSourceMap'.
error TS5050: Option 'mapRoot' cannot be specified with option 'inlineSourceMap'.
tests/cases/compiler/inlineSourceMap2.ts(5,1): error TS2304: Cannot find name 'console'.
!!! error TS5050: Option 'mapRoot' cannot be specified with option 'inlineSourceMap'.
!!! error TS5049: Option 'sourceRoot' cannot be specified with option 'inlineSourceMap'.
!!! error TS5048: Option 'sourceMap' cannot be specified with option 'inlineSourceMap'.
!!! error TS5049: Option 'sourceRoot' cannot be specified with option 'inlineSourceMap'.
!!! error TS5050: Option 'mapRoot' cannot be specified with option 'inlineSourceMap'.
==== tests/cases/compiler/inlineSourceMap2.ts (1 errors) ====
// configuration errors

View File

@@ -1,10 +1,10 @@
error TS2318: Cannot find global type 'IArguments'.
error TS2318: Cannot find global type 'Boolean'.
error TS2318: Cannot find global type 'IArguments'.
tests/cases/compiler/noDefaultLib.ts(4,11): error TS2317: Global type 'Array' must have 1 type parameter(s).
!!! error TS2318: Cannot find global type 'IArguments'.
!!! error TS2318: Cannot find global type 'Boolean'.
!!! error TS2318: Cannot find global type 'IArguments'.
==== tests/cases/compiler/noDefaultLib.ts (1 errors) ====
/// <reference no-default-lib="true"/>
var x;

View File

@@ -1,21 +1,21 @@
error TS2318: Cannot find global type 'String'.
error TS2318: Cannot find global type 'RegExp'.
error TS2318: Cannot find global type 'Object'.
error TS2318: Cannot find global type 'Number'.
error TS2318: Cannot find global type 'IArguments'.
error TS2318: Cannot find global type 'Function'.
error TS2318: Cannot find global type 'Boolean'.
error TS2318: Cannot find global type 'Array'.
error TS2318: Cannot find global type 'Boolean'.
error TS2318: Cannot find global type 'Function'.
error TS2318: Cannot find global type 'IArguments'.
error TS2318: Cannot find global type 'Number'.
error TS2318: Cannot find global type 'Object'.
error TS2318: Cannot find global type 'RegExp'.
error TS2318: Cannot find global type 'String'.
!!! error TS2318: Cannot find global type 'String'.
!!! error TS2318: Cannot find global type 'RegExp'.
!!! error TS2318: Cannot find global type 'Object'.
!!! error TS2318: Cannot find global type 'Number'.
!!! error TS2318: Cannot find global type 'IArguments'.
!!! error TS2318: Cannot find global type 'Function'.
!!! error TS2318: Cannot find global type 'Boolean'.
!!! error TS2318: Cannot find global type 'Array'.
!!! error TS2318: Cannot find global type 'Boolean'.
!!! error TS2318: Cannot find global type 'Function'.
!!! error TS2318: Cannot find global type 'IArguments'.
!!! error TS2318: Cannot find global type 'Number'.
!!! error TS2318: Cannot find global type 'Object'.
!!! error TS2318: Cannot find global type 'RegExp'.
!!! error TS2318: Cannot find global type 'String'.
==== tests/cases/conformance/parser/ecmascript5/RegressionTests/parser509698.ts (0 errors) ====
/// <style requireSemi="on" />
/// <reference no-default-lib="true"/>

View File

@@ -7,10 +7,9 @@ tests/cases/conformance/parser/ecmascript5/Generics/parserGenericsInTypeContexts
tests/cases/conformance/parser/ecmascript5/Generics/parserGenericsInTypeContexts1.ts(8,9): error TS2304: Cannot find name 'K'.
tests/cases/conformance/parser/ecmascript5/Generics/parserGenericsInTypeContexts1.ts(11,16): error TS2304: Cannot find name 'E'.
tests/cases/conformance/parser/ecmascript5/Generics/parserGenericsInTypeContexts1.ts(14,16): error TS2304: Cannot find name 'F'.
tests/cases/conformance/parser/ecmascript5/Generics/parserGenericsInTypeContexts1.ts(14,16): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement.
==== tests/cases/conformance/parser/ecmascript5/Generics/parserGenericsInTypeContexts1.ts (10 errors) ====
==== tests/cases/conformance/parser/ecmascript5/Generics/parserGenericsInTypeContexts1.ts (9 errors) ====
class C extends A<T> implements B<T> {
~
!!! error TS2304: Cannot find name 'A'.
@@ -43,8 +42,6 @@ tests/cases/conformance/parser/ecmascript5/Generics/parserGenericsInTypeContexts
function f2(): F<T> {
~
!!! error TS2304: Cannot find name 'F'.
~~~~
!!! error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement.
}

View File

@@ -7,10 +7,9 @@ tests/cases/conformance/parser/ecmascript5/Generics/parserGenericsInTypeContexts
tests/cases/conformance/parser/ecmascript5/Generics/parserGenericsInTypeContexts2.ts(8,9): error TS2304: Cannot find name 'K'.
tests/cases/conformance/parser/ecmascript5/Generics/parserGenericsInTypeContexts2.ts(11,16): error TS2304: Cannot find name 'E'.
tests/cases/conformance/parser/ecmascript5/Generics/parserGenericsInTypeContexts2.ts(14,16): error TS2304: Cannot find name 'F'.
tests/cases/conformance/parser/ecmascript5/Generics/parserGenericsInTypeContexts2.ts(14,16): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement.
==== tests/cases/conformance/parser/ecmascript5/Generics/parserGenericsInTypeContexts2.ts (10 errors) ====
==== tests/cases/conformance/parser/ecmascript5/Generics/parserGenericsInTypeContexts2.ts (9 errors) ====
class C extends A<X<T>, Y<Z<T>>> implements B<X<T>, Y<Z<T>>> {
~
!!! error TS2304: Cannot find name 'A'.
@@ -43,8 +42,6 @@ tests/cases/conformance/parser/ecmascript5/Generics/parserGenericsInTypeContexts
function f2(): F<X<T>, Y<Z<T>>> {
~
!!! error TS2304: Cannot find name 'F'.
~~~~~~~~~~~~~~~~
!!! error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement.
}

View File

@@ -1,11 +1,8 @@
tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArrowFunctions/parserX_ArrowFunction3.ts(1,13): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement.
tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArrowFunctions/parserX_ArrowFunction3.ts(1,14): error TS1110: Type expected.
==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArrowFunctions/parserX_ArrowFunction3.ts (2 errors) ====
==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArrowFunctions/parserX_ArrowFunction3.ts (1 errors) ====
var v = (a): => {
!!! error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement.
~~
!!! error TS1110: Type expected.

View File

@@ -1,6 +1,6 @@
error TS6054: File 'a.t' has unsupported extension. The only supported extensions are '.ts', '.d.ts'.
error TS6053: File 'a.ts' not found.
error TS6054: File 'a.t' has unsupported extension. The only supported extensions are '.ts', '.d.ts'.
!!! error TS6054: File 'a.t' has unsupported extension. The only supported extensions are '.ts', '.d.ts'.
!!! error TS6053: File 'a.ts' not found.
!!! error TS6053: File 'a.ts' not found.
!!! error TS6054: File 'a.t' has unsupported extension. The only supported extensions are '.ts', '.d.ts'.

View File

@@ -1,6 +1,6 @@
error TS6054: File 'a.t' has unsupported extension. The only supported extensions are '.ts', '.d.ts'.
error TS6053: File 'a.ts' not found.
error TS6054: File 'a.t' has unsupported extension. The only supported extensions are '.ts', '.d.ts'.
!!! error TS6054: File 'a.t' has unsupported extension. The only supported extensions are '.ts', '.d.ts'.
!!! error TS6053: File 'a.ts' not found.
!!! error TS6053: File 'a.ts' not found.
!!! error TS6054: File 'a.t' has unsupported extension. The only supported extensions are '.ts', '.d.ts'.

View File

@@ -1,9 +1,9 @@
error TS5039: Option 'sourceRoot' cannot be specified without specifying 'sourceMap' option.
error TS5038: Option 'mapRoot' cannot be specified without specifying 'sourceMap' option.
error TS5039: Option 'sourceRoot' cannot be specified without specifying 'sourceMap' option.
!!! error TS5039: Option 'sourceRoot' cannot be specified without specifying 'sourceMap' option.
!!! error TS5038: Option 'mapRoot' cannot be specified without specifying 'sourceMap' option.
!!! error TS5039: Option 'sourceRoot' cannot be specified without specifying 'sourceMap' option.
==== m1.ts (0 errors) ====
var m1_a1 = 10;
class m1_c1 {

View File

@@ -1,9 +1,9 @@
error TS5039: Option 'sourceRoot' cannot be specified without specifying 'sourceMap' option.
error TS5038: Option 'mapRoot' cannot be specified without specifying 'sourceMap' option.
error TS5039: Option 'sourceRoot' cannot be specified without specifying 'sourceMap' option.
!!! error TS5039: Option 'sourceRoot' cannot be specified without specifying 'sourceMap' option.
!!! error TS5038: Option 'mapRoot' cannot be specified without specifying 'sourceMap' option.
!!! error TS5039: Option 'sourceRoot' cannot be specified without specifying 'sourceMap' option.
==== m1.ts (0 errors) ====
var m1_a1 = 10;
class m1_c1 {

View File

@@ -1,22 +1,22 @@
error TS2318: Cannot find global type 'String'.
error TS2318: Cannot find global type 'RegExp'.
error TS2318: Cannot find global type 'Object'.
error TS2318: Cannot find global type 'Number'.
error TS2318: Cannot find global type 'IArguments'.
error TS2318: Cannot find global type 'Function'.
error TS2318: Cannot find global type 'Boolean'.
error TS2318: Cannot find global type 'Array'.
error TS2318: Cannot find global type 'Boolean'.
error TS2318: Cannot find global type 'Function'.
error TS2318: Cannot find global type 'IArguments'.
error TS2318: Cannot find global type 'Number'.
error TS2318: Cannot find global type 'Object'.
error TS2318: Cannot find global type 'RegExp'.
error TS2318: Cannot find global type 'String'.
test.ts(3,8): error TS2304: Cannot find name 'Array'.
!!! error TS2318: Cannot find global type 'String'.
!!! error TS2318: Cannot find global type 'RegExp'.
!!! error TS2318: Cannot find global type 'Object'.
!!! error TS2318: Cannot find global type 'Number'.
!!! error TS2318: Cannot find global type 'IArguments'.
!!! error TS2318: Cannot find global type 'Function'.
!!! error TS2318: Cannot find global type 'Boolean'.
!!! error TS2318: Cannot find global type 'Array'.
!!! error TS2318: Cannot find global type 'Boolean'.
!!! error TS2318: Cannot find global type 'Function'.
!!! error TS2318: Cannot find global type 'IArguments'.
!!! error TS2318: Cannot find global type 'Number'.
!!! error TS2318: Cannot find global type 'Object'.
!!! error TS2318: Cannot find global type 'RegExp'.
!!! error TS2318: Cannot find global type 'String'.
==== test.ts (1 errors) ====
/// <reference no-default-lib="true"/>

View File

@@ -1,22 +1,22 @@
error TS2318: Cannot find global type 'String'.
error TS2318: Cannot find global type 'RegExp'.
error TS2318: Cannot find global type 'Object'.
error TS2318: Cannot find global type 'Number'.
error TS2318: Cannot find global type 'IArguments'.
error TS2318: Cannot find global type 'Function'.
error TS2318: Cannot find global type 'Boolean'.
error TS2318: Cannot find global type 'Array'.
error TS2318: Cannot find global type 'Boolean'.
error TS2318: Cannot find global type 'Function'.
error TS2318: Cannot find global type 'IArguments'.
error TS2318: Cannot find global type 'Number'.
error TS2318: Cannot find global type 'Object'.
error TS2318: Cannot find global type 'RegExp'.
error TS2318: Cannot find global type 'String'.
test.ts(3,8): error TS2304: Cannot find name 'Array'.
!!! error TS2318: Cannot find global type 'String'.
!!! error TS2318: Cannot find global type 'RegExp'.
!!! error TS2318: Cannot find global type 'Object'.
!!! error TS2318: Cannot find global type 'Number'.
!!! error TS2318: Cannot find global type 'IArguments'.
!!! error TS2318: Cannot find global type 'Function'.
!!! error TS2318: Cannot find global type 'Boolean'.
!!! error TS2318: Cannot find global type 'Array'.
!!! error TS2318: Cannot find global type 'Boolean'.
!!! error TS2318: Cannot find global type 'Function'.
!!! error TS2318: Cannot find global type 'IArguments'.
!!! error TS2318: Cannot find global type 'Number'.
!!! error TS2318: Cannot find global type 'Object'.
!!! error TS2318: Cannot find global type 'RegExp'.
!!! error TS2318: Cannot find global type 'String'.
==== test.ts (1 errors) ====
/// <reference no-default-lib="true"/>

View File

@@ -1,11 +1,11 @@
error TS2318: Cannot find global type 'String'.
error TS2318: Cannot find global type 'Array'.
error TS2318: Cannot find global type 'IArguments'.
error TS2318: Cannot find global type 'Boolean'.
error TS2318: Cannot find global type 'RegExp'.
error TS2318: Cannot find global type 'Object'.
error TS2318: Cannot find global type 'Number'.
error TS2318: Cannot find global type 'Function'.
error TS2318: Cannot find global type 'IArguments'.
error TS2318: Cannot find global type 'Number'.
error TS2318: Cannot find global type 'Object'.
error TS2318: Cannot find global type 'RegExp'.
error TS2318: Cannot find global type 'String'.
tests/cases/compiler/typeCheckTypeArgument.ts(3,19): error TS2304: Cannot find name 'UNKNOWN'.
tests/cases/compiler/typeCheckTypeArgument.ts(5,26): error TS2304: Cannot find name 'UNKNOWN'.
tests/cases/compiler/typeCheckTypeArgument.ts(7,21): error TS2304: Cannot find name 'UNKNOWN'.
@@ -14,14 +14,14 @@ tests/cases/compiler/typeCheckTypeArgument.ts(12,22): error TS2304: Cannot find
tests/cases/compiler/typeCheckTypeArgument.ts(15,13): error TS2304: Cannot find name 'UNKNOWN'.
!!! error TS2318: Cannot find global type 'String'.
!!! error TS2318: Cannot find global type 'Array'.
!!! error TS2318: Cannot find global type 'IArguments'.
!!! error TS2318: Cannot find global type 'Boolean'.
!!! error TS2318: Cannot find global type 'RegExp'.
!!! error TS2318: Cannot find global type 'Object'.
!!! error TS2318: Cannot find global type 'Number'.
!!! error TS2318: Cannot find global type 'Function'.
!!! error TS2318: Cannot find global type 'IArguments'.
!!! error TS2318: Cannot find global type 'Number'.
!!! error TS2318: Cannot find global type 'Object'.
!!! error TS2318: Cannot find global type 'RegExp'.
!!! error TS2318: Cannot find global type 'String'.
==== tests/cases/compiler/typeCheckTypeArgument.ts (6 errors) ====
/// <reference no-default-lib="true"/>

View File

@@ -7,16 +7,12 @@ tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsed
tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(15,8): error TS2304: Cannot find name 'W'.
tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(19,17): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list.
tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(19,43): error TS2304: Cannot find name 'V'.
tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(19,43): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement.
tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(20,47): error TS2304: Cannot find name 'X'.
tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(20,47): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement.
tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(22,13): error TS2322: Type 'U' is not assignable to type 'T'.
tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(23,20): error TS2322: Type 'U' is not assignable to type 'T'.
tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(28,15): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list.
tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(28,44): error TS2304: Cannot find name 'W'.
tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(28,44): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement.
tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(29,47): error TS2304: Cannot find name 'Y'.
tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(29,47): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement.
tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(31,13): error TS2322: Type 'U' is not assignable to type 'T'.
tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(32,20): error TS2322: Type 'U' is not assignable to type 'T'.
tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(37,14): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list.
@@ -29,7 +25,7 @@ tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsed
tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(46,36): error TS2304: Cannot find name 'X'.
==== tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts (29 errors) ====
==== tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts (25 errors) ====
// Type parameters are in scope in their own and other type parameter lists
// Some negative cases
@@ -67,13 +63,9 @@ tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsed
!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list.
~
!!! error TS2304: Cannot find name 'V'.
~
!!! error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement.
function bar<V extends T, W extends U>(): X { // error
~
!!! error TS2304: Cannot find name 'X'.
~
!!! error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement.
function baz<X extends W, Y extends V>(a: X, b: Y): T {
x = y;
~
@@ -90,13 +82,9 @@ tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsed
!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list.
~
!!! error TS2304: Cannot find name 'W'.
~
!!! error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement.
function bar<V extends T, W extends U>(): Y { // error
~
!!! error TS2304: Cannot find name 'Y'.
~
!!! error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement.
function baz<X extends W, Y extends V>(a: X, b: Y): T {
x = y;
~

View File

@@ -2,7 +2,6 @@ tests/cases/compiler/unknownSymbols1.ts(1,9): error TS2304: Cannot find name 'as
tests/cases/compiler/unknownSymbols1.ts(2,8): error TS2304: Cannot find name 'asdf'.
tests/cases/compiler/unknownSymbols1.ts(4,17): error TS2304: Cannot find name 'asdf'.
tests/cases/compiler/unknownSymbols1.ts(4,35): error TS2304: Cannot find name 'asdf'.
tests/cases/compiler/unknownSymbols1.ts(4,35): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement.
tests/cases/compiler/unknownSymbols1.ts(6,12): error TS2304: Cannot find name 'asdf'.
tests/cases/compiler/unknownSymbols1.ts(9,10): error TS2304: Cannot find name 'asdf'.
tests/cases/compiler/unknownSymbols1.ts(12,10): error TS2304: Cannot find name 'asdf'.
@@ -14,7 +13,7 @@ tests/cases/compiler/unknownSymbols1.ts(30,14): error TS2339: Property 'asdf' do
tests/cases/compiler/unknownSymbols1.ts(30,21): error TS2304: Cannot find name 'asdf'.
==== tests/cases/compiler/unknownSymbols1.ts (14 errors) ====
==== tests/cases/compiler/unknownSymbols1.ts (13 errors) ====
var x = asdf;
~~~~
!!! error TS2304: Cannot find name 'asdf'.
@@ -27,8 +26,6 @@ tests/cases/compiler/unknownSymbols1.ts(30,21): error TS2304: Cannot find name '
!!! error TS2304: Cannot find name 'asdf'.
~~~~
!!! error TS2304: Cannot find name 'asdf'.
~~~~
!!! error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement.
function foo2() {
return asdf;
~~~~

View File

@@ -1,4 +1,3 @@
// @normalizenewline: \n
// @sourcemap: true
// DEFAULT INTERFACES
interface IFoo {

View File

@@ -0,0 +1,20 @@
function foo<T>() {
var z = foo<typeof y>();
var y: {
y2: typeof z
};
return y;
}
function bar<T>() {
var z = bar<typeof y>();
var y: {
y2: typeof z;
}
return y;
}
var a = foo<number>();
var b = bar<number>();
a = b;

View File

@@ -0,0 +1,2 @@
//@target: ES5
var { x } = <any>foo();

View File

@@ -0,0 +1,2 @@
//@target: ES5
var { x } = (<any>foo());

View File

@@ -0,0 +1,2 @@
//@target: ES5
var { x } = <any>(foo());

View File

@@ -0,0 +1,2 @@
//@target: ES5
var { x } = <any><any>foo();

View File

@@ -0,0 +1,2 @@
//@target: ES5
var { x } = <any>0;

View File

@@ -0,0 +1,2 @@
//@target: ES5
var { x } = <any>new Foo;

View File

@@ -0,0 +1,2 @@
//@target: ES5
var { x } = <any><any>new Foo;

View File

@@ -0,0 +1,59 @@
/// <reference path="..\..\..\src\harness\harness.ts" />
module ts {
describe("Transpile", () => {
function runTest(input: string, compilerOptions: ts.CompilerOptions = {}, expectedOutput?: string, expectedDiagnosticCodes: number[] = []): void {
let diagnostics: Diagnostic[] = [];
let result = transpile(input, compilerOptions, "file.ts", diagnostics);
for (let i = 0; i < expectedDiagnosticCodes.length; i++) {
assert.equal(expectedDiagnosticCodes[i], diagnostics[i] && diagnostics[i].code, `Could not find expeced diagnostic.`);
}
assert.equal(diagnostics.length, expectedDiagnosticCodes.length, "Resuting diagnostics count does not match expected");
if (expectedOutput !== undefined) {
assert.equal(result, expectedOutput);
}
}
it("Generates correct compilerOptions diagnostics", () => {
// Expecting 5047: "Option 'isolatedModules' can only be used when either option'--module' is provided or option 'target' is 'ES6' or higher."
runTest(`var x = 0;`, {}, /*expectedOutput*/ undefined, /*expectedDiagnosticCodes*/ [5047]);
});
it("Generates no diagnostics with valid inputs", () => {
// No errors
runTest(`var x = 0;`, { module: ModuleKind.CommonJS }, /*expectedOutput*/ undefined, /*expectedDiagnosticCodes*/ []);
});
it("Generates no diagnostics for missing file references", () => {
runTest(`/// <reference path="file2.ts" />
var x = 0;`,
{ module: ModuleKind.CommonJS }, /*expectedOutput*/ undefined, /*expectedDiagnosticCodes*/ []);
});
it("Generates no diagnostics for missing module imports", () => {
runTest(`import {a} from "module2";`,
{ module: ModuleKind.CommonJS }, /*expectedOutput*/ undefined, /*expectedDiagnosticCodes*/ []);
});
it("Generates expected syntactic diagnostics", () => {
runTest(`a b`,
{ module: ModuleKind.CommonJS }, /*expectedOutput*/ undefined, /*expectedDiagnosticCodes*/ [1005]); /// 1005: ';' Expected
});
it("Does not generate semantic diagnostics", () => {
runTest(`var x: string = 0;`,
{ module: ModuleKind.CommonJS }, /*expectedOutput*/ undefined, /*expectedDiagnosticCodes*/ []);
});
it("Generates module output", () => {
runTest(`var x = 0;`, { module: ModuleKind.AMD }, `define(["require", "exports"], function (require, exports) {\r\n var x = 0;\r\n});\r\n`);
});
it("Uses correct newLine character", () => {
runTest(`var x = 0;`, { module: ModuleKind.CommonJS, newLine: NewLineKind.LineFeed }, `var x = 0;\n`, /*expectedDiagnosticCodes*/ []);
});
});
}