blob: edfaeac9b461b99a761e3a41c12d976d28ac3233 [file] [log] [blame]
library /*isNonNullableByDefault*/;
//
// Problems in library:
//
// pkg/front_end/testcases/constructor_tearoffs/call_instantiation.dart:7:33: Error: A value of type 'T Function<T>(T)' can't be assigned to a variable of type 'int Function(int)'.
// int Function(int) f = funcValue.call; // Disallowed!
// ^
//
// pkg/front_end/testcases/constructor_tearoffs/call_instantiation.dart:11:31: Error: The static type of the explicit instantiation operand must be a generic function type but is 'Function'.
// - 'Function' is from 'dart:core'.
// Try changing the operand or remove the type arguments.
// int Function(int) g = f.call<int>; // Disallowed!
// ^
//
import self as self;
import "dart:core" as core;
static field <T extends core::Object? = dynamic>(T%) T% funcValue = #C1;
static field (core::int) core::int f = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/call_instantiation.dart:7:33: Error: A value of type 'T Function<T>(T)' can't be assigned to a variable of type 'int Function(int)'.
int Function(int) f = funcValue.call; // Disallowed!
^" in self::funcValue.call as{TypeError,ForNonNullableByDefault} (core::int) core::int;
static field (core::int) core::int g = self::funcValue.call<core::int>;
static method func<T extends core::Object? = dynamic>(self::func::T% value) self::func::T%
return value;
static method test(core::Function f) dynamic {
(core::int) core::int g = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/call_instantiation.dart:11:31: Error: The static type of the explicit instantiation operand must be a generic function type but is 'Function'.
- 'Function' is from 'dart:core'.
Try changing the operand or remove the type arguments.
int Function(int) g = f.call<int>; // Disallowed!
^";
}
static method main() dynamic {}
constants {
#C1 = static-tearoff self::func
}