TypeScript/tests/cases/compiler/arrowFunctionErrorSpan.ts
2016-03-29 11:51:04 -07:00

54 lines
660 B
TypeScript

function f(a: () => number) { }
// oneliner
f(() => { });
// multiline, body
f(() => {
});
// multiline 2, body
f(() => {
});
// multiline 3, arrow on a new line
f(()
=> { });
// multiline 4, arguments
f((a,
b,
c,
d) => { });
// single line with a comment
f(/*
*/() => { });
// multi line with a comment
f(/*
*/() => { });
// multi line with a comment 2
f(/*
*/() => {
});
// multi line with a comment 3
f( // comment 1
// comment 2
() =>
// comment 3
{
// comment 4
}
// comment 5
);
// body is not a block
f(_ => 1 +
2);