blob: 43082f13e7a694aea2f42ff4bcd069d49ee91e88 [file] [log] [blame] [edit]
library;
//
// Problems in library:
//
// pkg/front_end/testcases/general/bounded_implicit_instantiation.dart:7:22: Error: The argument type 'String' can't be assigned to the parameter type 'Never'.
// String a = bounded('');
// ^
//
// pkg/front_end/testcases/general/bounded_implicit_instantiation.dart:8:21: Error: Type argument 'String' doesn't conform to the bound 'num' of the type variable 'X' on 'bounded'.
// Try changing type arguments so that they conform to the bounds.
// String b = bounded<String>('');
// ^
//
// pkg/front_end/testcases/general/bounded_implicit_instantiation.dart:9:31: Error: A value of type 'num Function(num)' can't be assigned to a variable of type 'String Function(String)'.
// String Function(String) c = bounded;
// ^
//
import self as self;
import "dart:core" as core;
static method test() dynamic {
function bounded<X extends core::num>(X x) X
return x;
core::String a = bounded<Never>(invalid-expression "pkg/front_end/testcases/general/bounded_implicit_instantiation.dart:7:22: Error: The argument type 'String' can't be assigned to the parameter type 'Never'.
String a = bounded('');
^" in "" as{TypeError} Never){(Never) Never};
core::String b = bounded<core::String>(""){(core::String) core::String};
(core::String) core::String c = invalid-expression "pkg/front_end/testcases/general/bounded_implicit_instantiation.dart:9:31: Error: A value of type 'num Function(num)' can't be assigned to a variable of type 'String Function(String)'.
String Function(String) c = bounded;
^" in (bounded<core::num>) as{TypeError} (core::String) core::String;
core::String d = c(""){(core::String) core::String};
}
static method main() dynamic {}