blob: a9b5b5d722ab5fc14182557092e4d6903edb8804 [file] [log] [blame]
40 columns |
### Tests for anonymous function expressions: "lambdas".
>>> Generic.
f = < T , S extends T > ( T param ) { } ;
<<<
f = <T, S extends T>(T param) {};
>>> Async with block body.
f = ( ) async { } ;
<<<
f = () async {};
>>> Async with expression body.
f = ( ) async => 1;
<<<
f = () async => 1;
>>> Sync* with block body.
f = ( ) sync * { } ;
<<<
f = () sync* {};
>>> Sync* with expression body.
f = ( ) sync * => 1;
<<<
f = () sync* => 1;
>>> Aync* with block body.
f = ( ) async * { } ;
<<<
f = () async* {};
>>> Aync* with expression body.
f = ( ) async * => 1;
<<<
f = () async* => 1;
>>> Split parameter list.
function = (int firstArgument, int secondArgument) { print('42'); };
<<< 3.7
function = (
int firstArgument,
int secondArgument,
) {
print('42');
};
<<< 3.8
function =
(
int firstArgument,
int secondArgument,
) {
print('42');
};