-
Notifications
You must be signed in to change notification settings - Fork 12.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d63a4f1
commit 2ee80f1
Showing
40 changed files
with
611 additions
and
439 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 0 additions & 35 deletions
35
tests/baselines/reference/arrayOfFunctionTypes3.errors.txt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
=== tests/cases/conformance/types/specifyingTypes/typeLiterals/arrayOfFunctionTypes3.ts === | ||
// valid uses of arrays of function types | ||
|
||
var x = [() => 1, () => { }]; | ||
>x : Symbol(x, Decl(arrayOfFunctionTypes3.ts, 2, 3)) | ||
|
||
var r2 = x[0](); | ||
>r2 : Symbol(r2, Decl(arrayOfFunctionTypes3.ts, 3, 3)) | ||
>x : Symbol(x, Decl(arrayOfFunctionTypes3.ts, 2, 3)) | ||
|
||
class C { | ||
>C : Symbol(C, Decl(arrayOfFunctionTypes3.ts, 3, 16)) | ||
|
||
foo: string; | ||
>foo : Symbol(foo, Decl(arrayOfFunctionTypes3.ts, 5, 9)) | ||
} | ||
var y = [C, C]; | ||
>y : Symbol(y, Decl(arrayOfFunctionTypes3.ts, 8, 3)) | ||
>C : Symbol(C, Decl(arrayOfFunctionTypes3.ts, 3, 16)) | ||
>C : Symbol(C, Decl(arrayOfFunctionTypes3.ts, 3, 16)) | ||
|
||
var r3 = new y[0](); | ||
>r3 : Symbol(r3, Decl(arrayOfFunctionTypes3.ts, 9, 3)) | ||
>y : Symbol(y, Decl(arrayOfFunctionTypes3.ts, 8, 3)) | ||
|
||
var a: { (x: number): number; (x: string): string; }; | ||
>a : Symbol(a, Decl(arrayOfFunctionTypes3.ts, 11, 3)) | ||
>x : Symbol(x, Decl(arrayOfFunctionTypes3.ts, 11, 10)) | ||
>x : Symbol(x, Decl(arrayOfFunctionTypes3.ts, 11, 31)) | ||
|
||
var b: { (x: number): number; (x: string): string; }; | ||
>b : Symbol(b, Decl(arrayOfFunctionTypes3.ts, 12, 3)) | ||
>x : Symbol(x, Decl(arrayOfFunctionTypes3.ts, 12, 10)) | ||
>x : Symbol(x, Decl(arrayOfFunctionTypes3.ts, 12, 31)) | ||
|
||
var c: { (x: number): number; (x: any): any; }; | ||
>c : Symbol(c, Decl(arrayOfFunctionTypes3.ts, 13, 3)) | ||
>x : Symbol(x, Decl(arrayOfFunctionTypes3.ts, 13, 10)) | ||
>x : Symbol(x, Decl(arrayOfFunctionTypes3.ts, 13, 31)) | ||
|
||
var z = [a, b, c]; | ||
>z : Symbol(z, Decl(arrayOfFunctionTypes3.ts, 14, 3)) | ||
>a : Symbol(a, Decl(arrayOfFunctionTypes3.ts, 11, 3)) | ||
>b : Symbol(b, Decl(arrayOfFunctionTypes3.ts, 12, 3)) | ||
>c : Symbol(c, Decl(arrayOfFunctionTypes3.ts, 13, 3)) | ||
|
||
var r4 = z[0]; | ||
>r4 : Symbol(r4, Decl(arrayOfFunctionTypes3.ts, 15, 3)) | ||
>z : Symbol(z, Decl(arrayOfFunctionTypes3.ts, 14, 3)) | ||
|
||
var r5 = r4(''); // any not string | ||
>r5 : Symbol(r5, Decl(arrayOfFunctionTypes3.ts, 16, 3)) | ||
>r4 : Symbol(r4, Decl(arrayOfFunctionTypes3.ts, 15, 3)) | ||
|
||
var r5b = r4(1); | ||
>r5b : Symbol(r5b, Decl(arrayOfFunctionTypes3.ts, 17, 3)) | ||
>r4 : Symbol(r4, Decl(arrayOfFunctionTypes3.ts, 15, 3)) | ||
|
||
var a2: { <T>(x: T): number; (x: string): string;}; | ||
>a2 : Symbol(a2, Decl(arrayOfFunctionTypes3.ts, 19, 3)) | ||
>T : Symbol(T, Decl(arrayOfFunctionTypes3.ts, 19, 11)) | ||
>x : Symbol(x, Decl(arrayOfFunctionTypes3.ts, 19, 14)) | ||
>T : Symbol(T, Decl(arrayOfFunctionTypes3.ts, 19, 11)) | ||
>x : Symbol(x, Decl(arrayOfFunctionTypes3.ts, 19, 30)) | ||
|
||
var b2: { <T>(x: T): number; (x: string): string; }; | ||
>b2 : Symbol(b2, Decl(arrayOfFunctionTypes3.ts, 20, 3)) | ||
>T : Symbol(T, Decl(arrayOfFunctionTypes3.ts, 20, 11)) | ||
>x : Symbol(x, Decl(arrayOfFunctionTypes3.ts, 20, 14)) | ||
>T : Symbol(T, Decl(arrayOfFunctionTypes3.ts, 20, 11)) | ||
>x : Symbol(x, Decl(arrayOfFunctionTypes3.ts, 20, 30)) | ||
|
||
var c2: { (x: number): number; <T>(x: T): any; }; | ||
>c2 : Symbol(c2, Decl(arrayOfFunctionTypes3.ts, 21, 3)) | ||
>x : Symbol(x, Decl(arrayOfFunctionTypes3.ts, 21, 11)) | ||
>T : Symbol(T, Decl(arrayOfFunctionTypes3.ts, 21, 32)) | ||
>x : Symbol(x, Decl(arrayOfFunctionTypes3.ts, 21, 35)) | ||
>T : Symbol(T, Decl(arrayOfFunctionTypes3.ts, 21, 32)) | ||
|
||
var z2 = [a2, b2, c2]; | ||
>z2 : Symbol(z2, Decl(arrayOfFunctionTypes3.ts, 23, 3)) | ||
>a2 : Symbol(a2, Decl(arrayOfFunctionTypes3.ts, 19, 3)) | ||
>b2 : Symbol(b2, Decl(arrayOfFunctionTypes3.ts, 20, 3)) | ||
>c2 : Symbol(c2, Decl(arrayOfFunctionTypes3.ts, 21, 3)) | ||
|
||
var r6 = z2[0]; | ||
>r6 : Symbol(r6, Decl(arrayOfFunctionTypes3.ts, 24, 3)) | ||
>z2 : Symbol(z2, Decl(arrayOfFunctionTypes3.ts, 23, 3)) | ||
|
||
var r7 = r6(''); // any not string | ||
>r7 : Symbol(r7, Decl(arrayOfFunctionTypes3.ts, 25, 3)) | ||
>r6 : Symbol(r6, Decl(arrayOfFunctionTypes3.ts, 24, 3)) | ||
|
Oops, something went wrong.