Files
sdk/pkg/front_end/testcases/general/illegal_named_function_expression.dart.weak.expect
T
Johnni Winther 36641368bb [cfe] Treat NonNullableByDefault as default in ast-to-text
This changes ast-to-text to mark legacy libraries instead of
non-nullable-by-default libraries.

TEST=existing

Change-Id: Ib01147e4ef48c2c5b2ffc6b23547998344dfdf2e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/307121
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2023-06-08 06:28:50 +00:00

29 lines
1.1 KiB
Plaintext

library;
//
// Problems in library:
//
// pkg/front_end/testcases/general/illegal_named_function_expression.dart:6:16: Error: A function expression can't have a name.
// var x = void f<T>(T t) {};
// ^
//
// pkg/front_end/testcases/general/illegal_named_function_expression.dart:8:14: Error: A function expression can't have a name.
// print(void g<T>(T t) {});
// ^
//
import self as self;
import "dart:core" as core;
static method test() → dynamic {
invalid-type x = block {
function f<T extends core::Object? = dynamic>(T% t) → void {}
} =>invalid-expression "pkg/front_end/testcases/general/illegal_named_function_expression.dart:6:11: Error: A function expression can't have a name.
var x = void f<T>(T t) {};
^";
core::print(x.{core::Object::runtimeType}{core::Type});
core::print( block {
function g<T extends core::Object? = dynamic>(T% t) → void {}
} =>invalid-expression "pkg/front_end/testcases/general/illegal_named_function_expression.dart:8:9: Error: A function expression can't have a name.
print(void g<T>(T t) {});
^");
}