2014-08-15 23:33:16 +02:00
|
|
|
=== tests/cases/compiler/methodContainingLocalFunction.ts ===
|
|
|
|
// The first case here (BugExhibition<T>) caused a crash. Try with different permutations of features.
|
|
|
|
class BugExhibition<T> {
|
2015-04-13 22:54:22 +02:00
|
|
|
>BugExhibition : BugExhibition<T>, Symbol(BugExhibition,Decl(methodContainingLocalFunction.ts,0,0))
|
|
|
|
>T : T, Symbol(T,Decl(methodContainingLocalFunction.ts,1,20))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
public exhibitBug() {
|
2015-04-13 22:54:22 +02:00
|
|
|
>exhibitBug : () => void, Symbol(exhibitBug,Decl(methodContainingLocalFunction.ts,1,24))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
function localFunction() { }
|
2015-04-13 22:54:22 +02:00
|
|
|
>localFunction : () => void, Symbol(localFunction,Decl(methodContainingLocalFunction.ts,2,25))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
var x: { (): void; };
|
2015-04-13 22:54:22 +02:00
|
|
|
>x : () => void, Symbol(x,Decl(methodContainingLocalFunction.ts,4,11))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
x = localFunction;
|
|
|
|
>x = localFunction : () => void
|
2015-04-13 22:54:22 +02:00
|
|
|
>x : () => void, Symbol(x,Decl(methodContainingLocalFunction.ts,4,11))
|
|
|
|
>localFunction : () => void, Symbol(localFunction,Decl(methodContainingLocalFunction.ts,2,25))
|
2014-08-15 23:33:16 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class BugExhibition2<T> {
|
2015-04-13 22:54:22 +02:00
|
|
|
>BugExhibition2 : BugExhibition2<T>, Symbol(BugExhibition2,Decl(methodContainingLocalFunction.ts,7,1))
|
|
|
|
>T : T, Symbol(T,Decl(methodContainingLocalFunction.ts,9,21))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
private static get exhibitBug() {
|
2015-04-13 22:54:22 +02:00
|
|
|
>exhibitBug : any, Symbol(BugExhibition2.exhibitBug,Decl(methodContainingLocalFunction.ts,9,25))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
function localFunction() { }
|
2015-04-13 22:54:22 +02:00
|
|
|
>localFunction : () => void, Symbol(localFunction,Decl(methodContainingLocalFunction.ts,10,37))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
var x: { (): void; };
|
2015-04-13 22:54:22 +02:00
|
|
|
>x : () => void, Symbol(x,Decl(methodContainingLocalFunction.ts,12,11))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
x = localFunction;
|
|
|
|
>x = localFunction : () => void
|
2015-04-13 22:54:22 +02:00
|
|
|
>x : () => void, Symbol(x,Decl(methodContainingLocalFunction.ts,12,11))
|
|
|
|
>localFunction : () => void, Symbol(localFunction,Decl(methodContainingLocalFunction.ts,10,37))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
return null;
|
2015-04-13 21:36:11 +02:00
|
|
|
>null : null
|
2014-08-15 23:33:16 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class BugExhibition3<T> {
|
2015-04-13 22:54:22 +02:00
|
|
|
>BugExhibition3 : BugExhibition3<T>, Symbol(BugExhibition3,Decl(methodContainingLocalFunction.ts,16,1))
|
|
|
|
>T : T, Symbol(T,Decl(methodContainingLocalFunction.ts,18,21))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
public exhibitBug() {
|
2015-04-13 22:54:22 +02:00
|
|
|
>exhibitBug : () => void, Symbol(exhibitBug,Decl(methodContainingLocalFunction.ts,18,25))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
function localGenericFunction<U>(u?: U) { }
|
2015-04-13 22:54:22 +02:00
|
|
|
>localGenericFunction : <U>(u?: U) => void, Symbol(localGenericFunction,Decl(methodContainingLocalFunction.ts,19,25))
|
|
|
|
>U : U, Symbol(U,Decl(methodContainingLocalFunction.ts,20,38))
|
|
|
|
>u : U, Symbol(u,Decl(methodContainingLocalFunction.ts,20,41))
|
|
|
|
>U : U, Symbol(U,Decl(methodContainingLocalFunction.ts,20,38))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
var x: { (): void; };
|
2015-04-13 22:54:22 +02:00
|
|
|
>x : () => void, Symbol(x,Decl(methodContainingLocalFunction.ts,21,11))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
x = localGenericFunction;
|
|
|
|
>x = localGenericFunction : <U>(u?: U) => void
|
2015-04-13 22:54:22 +02:00
|
|
|
>x : () => void, Symbol(x,Decl(methodContainingLocalFunction.ts,21,11))
|
|
|
|
>localGenericFunction : <U>(u?: U) => void, Symbol(localGenericFunction,Decl(methodContainingLocalFunction.ts,19,25))
|
2014-08-15 23:33:16 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class C {
|
2015-04-13 22:54:22 +02:00
|
|
|
>C : C, Symbol(C,Decl(methodContainingLocalFunction.ts,24,1))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
exhibit() {
|
2015-04-13 22:54:22 +02:00
|
|
|
>exhibit : () => void, Symbol(exhibit,Decl(methodContainingLocalFunction.ts,26,9))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
var funcExpr = <U>(u?: U) => { };
|
2015-04-13 22:54:22 +02:00
|
|
|
>funcExpr : <U>(u?: U) => void, Symbol(funcExpr,Decl(methodContainingLocalFunction.ts,28,11))
|
2014-08-15 23:33:16 +02:00
|
|
|
><U>(u?: U) => { } : <U>(u?: U) => void
|
2015-04-13 22:54:22 +02:00
|
|
|
>U : U, Symbol(U,Decl(methodContainingLocalFunction.ts,28,24))
|
|
|
|
>u : U, Symbol(u,Decl(methodContainingLocalFunction.ts,28,27))
|
|
|
|
>U : U, Symbol(U,Decl(methodContainingLocalFunction.ts,28,24))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
var x: { (): void; };
|
2015-04-13 22:54:22 +02:00
|
|
|
>x : () => void, Symbol(x,Decl(methodContainingLocalFunction.ts,29,11))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
x = funcExpr;
|
|
|
|
>x = funcExpr : <U>(u?: U) => void
|
2015-04-13 22:54:22 +02:00
|
|
|
>x : () => void, Symbol(x,Decl(methodContainingLocalFunction.ts,29,11))
|
|
|
|
>funcExpr : <U>(u?: U) => void, Symbol(funcExpr,Decl(methodContainingLocalFunction.ts,28,11))
|
2014-08-15 23:33:16 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
module M {
|
2015-04-13 22:54:22 +02:00
|
|
|
>M : typeof M, Symbol(M,Decl(methodContainingLocalFunction.ts,32,1))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
export function exhibitBug() {
|
2015-04-13 22:54:22 +02:00
|
|
|
>exhibitBug : () => void, Symbol(exhibitBug,Decl(methodContainingLocalFunction.ts,34,10))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
function localFunction() { }
|
2015-04-13 22:54:22 +02:00
|
|
|
>localFunction : () => void, Symbol(localFunction,Decl(methodContainingLocalFunction.ts,35,34))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
var x: { (): void; };
|
2015-04-13 22:54:22 +02:00
|
|
|
>x : () => void, Symbol(x,Decl(methodContainingLocalFunction.ts,37,11))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
x = localFunction;
|
|
|
|
>x = localFunction : () => void
|
2015-04-13 22:54:22 +02:00
|
|
|
>x : () => void, Symbol(x,Decl(methodContainingLocalFunction.ts,37,11))
|
|
|
|
>localFunction : () => void, Symbol(localFunction,Decl(methodContainingLocalFunction.ts,35,34))
|
2014-08-15 23:33:16 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
enum E {
|
2015-04-13 22:54:22 +02:00
|
|
|
>E : E, Symbol(E,Decl(methodContainingLocalFunction.ts,40,1))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
A = (() => {
|
2015-04-13 22:54:22 +02:00
|
|
|
>A : E, Symbol(E.A,Decl(methodContainingLocalFunction.ts,42,8))
|
2014-08-22 03:39:46 +02:00
|
|
|
>(() => { function localFunction() { } var x: { (): void; }; x = localFunction; return 0; })() : number
|
|
|
|
>(() => { function localFunction() { } var x: { (): void; }; x = localFunction; return 0; }) : () => number
|
|
|
|
>() => { function localFunction() { } var x: { (): void; }; x = localFunction; return 0; } : () => number
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
function localFunction() { }
|
2015-04-13 22:54:22 +02:00
|
|
|
>localFunction : () => void, Symbol(localFunction,Decl(methodContainingLocalFunction.ts,43,16))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
var x: { (): void; };
|
2015-04-13 22:54:22 +02:00
|
|
|
>x : () => void, Symbol(x,Decl(methodContainingLocalFunction.ts,45,11))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
x = localFunction;
|
|
|
|
>x = localFunction : () => void
|
2015-04-13 22:54:22 +02:00
|
|
|
>x : () => void, Symbol(x,Decl(methodContainingLocalFunction.ts,45,11))
|
|
|
|
>localFunction : () => void, Symbol(localFunction,Decl(methodContainingLocalFunction.ts,43,16))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
return 0;
|
2015-04-13 21:36:11 +02:00
|
|
|
>0 : number
|
|
|
|
|
2014-08-15 23:33:16 +02:00
|
|
|
})()
|
|
|
|
}
|