mirror of
https://github.com/dart-lang/sdk
synced 2024-09-18 21:21:18 +00:00
4bdad2194d
It is stil permissible to access methods/getters on Object (toString, ==, hashCode, etc.), even if the receiver type is not an InterfaceType, and we want type inference and kernel annotations to work correctly. Change-Id: I311b43c6de31faeefa85bc70636af05c62c4c1fe Reviewed-on: https://dart-review.googlesource.com/3385 Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
11 lines
1.1 KiB
Plaintext
11 lines
1.1 KiB
Plaintext
library;
|
|
import self as self;
|
|
import "dart:core" as core;
|
|
|
|
static const field dynamic #errors = const <dynamic>["pkg/front_end/testcases/illegal_named_function_expression.dart:6:11: Error: A function expression can't have a return type.\n var x = void f<T>(T t) {};\n ^", "pkg/front_end/testcases/illegal_named_function_expression.dart:6:16: Error: A function expression can't have a name.\n var x = void f<T>(T t) {};\n ^", "pkg/front_end/testcases/illegal_named_function_expression.dart:8:9: Error: A function expression can't have a return type.\n print(void g<T>(T t) {});\n ^", "pkg/front_end/testcases/illegal_named_function_expression.dart:8:14: Error: A function expression can't have a name.\n print(void g<T>(T t) {});\n ^"]/* from null */;
|
|
static method main() → dynamic {
|
|
<T extends core::Object>(T) → core::Null x = let final <T extends core::Object>(T) → core::Null f = <T extends core::Object>(T t) → core::Null {} in f;
|
|
core::print(x.{core::Object::runtimeType});
|
|
core::print(let final <T extends core::Object>(T) → core::Null g = <T extends core::Object>(T t) → core::Null {} in g);
|
|
}
|