| library test /*isNonNullableByDefault*/; |
| // |
| // Problems in library: |
| // |
| // pkg/front_end/testcases/inference/generic_methods_correctly_recognize_generic_upper_bound.dart:26:76: Error: Inferred type argument 'int' doesn't conform to the bound 'String' of the type variable 'U' on 'Foo<String>.method'. |
| // - 'Foo' is from 'pkg/front_end/testcases/inference/generic_methods_correctly_recognize_generic_upper_bound.dart'. |
| // Try specifying type arguments explicitly so that they conform to the bounds. |
| // . /*error:COULD_NOT_INFER*/ /*@typeArgs=int*/ /*@target=Foo.method*/ method( |
| // ^ |
| // |
| import self as self; |
| import "dart:core" as core; |
| |
| class Foo<T extends core::Pattern> extends core::Object { |
| synthetic constructor •() → self::Foo<self::Foo::T> |
| : super core::Object::•() |
| ; |
| method method<covariant-by-class U extends self::Foo::T>(self::Foo::method::U u) → self::Foo::method::U |
| return u; |
| } |
| static method main() → dynamic { |
| new self::Foo::•<core::String>().{self::Foo::method}<core::int>(42){(core::int) → core::int}; |
| } |