1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81
|
=== tests/cases/compiler/arrowFunctionErrorSpan.ts ===
function f(a: () => number) { }
>f : Symbol(f, Decl(arrowFunctionErrorSpan.ts, 0, 0))
>a : Symbol(a, Decl(arrowFunctionErrorSpan.ts, 0, 11))
// oneliner
f(() => { });
>f : Symbol(f, Decl(arrowFunctionErrorSpan.ts, 0, 0))
// multiline, body
f(() => {
>f : Symbol(f, Decl(arrowFunctionErrorSpan.ts, 0, 0))
});
// multiline 2, body
f(() => {
>f : Symbol(f, Decl(arrowFunctionErrorSpan.ts, 0, 0))
});
// multiline 3, arrow on a new line
f(()
>f : Symbol(f, Decl(arrowFunctionErrorSpan.ts, 0, 0))
=> { });
// multiline 4, arguments
f((a,
>f : Symbol(f, Decl(arrowFunctionErrorSpan.ts, 0, 0))
>a : Symbol(a, Decl(arrowFunctionErrorSpan.ts, 20, 3))
b,
>b : Symbol(b, Decl(arrowFunctionErrorSpan.ts, 20, 5))
c,
>c : Symbol(c, Decl(arrowFunctionErrorSpan.ts, 21, 6))
d) => { });
>d : Symbol(d, Decl(arrowFunctionErrorSpan.ts, 22, 6))
// single line with a comment
f(/*
>f : Symbol(f, Decl(arrowFunctionErrorSpan.ts, 0, 0))
*/() => { });
// multi line with a comment
f(/*
>f : Symbol(f, Decl(arrowFunctionErrorSpan.ts, 0, 0))
*/() => { });
// multi line with a comment 2
f(/*
>f : Symbol(f, Decl(arrowFunctionErrorSpan.ts, 0, 0))
*/() => {
});
// multi line with a comment 3
f( // comment 1
>f : Symbol(f, Decl(arrowFunctionErrorSpan.ts, 0, 0))
// comment 2
() =>
// comment 3
{
// comment 4
}
// comment 5
);
// body is not a block
f(_ => 1 +
>f : Symbol(f, Decl(arrowFunctionErrorSpan.ts, 0, 0))
>_ : Symbol(_, Decl(arrowFunctionErrorSpan.ts, 51, 2))
2);
|