| // Formatted problems: |
| // |
| // pkg/front_end/testcases/inference/generic_methods_correctly_recognize_generic_upper_bound.dart:26:77: Error: Inferred type argument 'dart.core::int' violates the corresponding type variable bound of 'Foo<dart.core::String>::method'. |
| // Try specifying type arguments explicitly so that they conform to the bounds. |
| // . /*error:COULD_NOT_INFER*/ /*@typeArgs=int*/ /*@target=Foo::method*/ method( |
| // ^ |
| // |
| // pkg/front_end/testcases/inference/generic_methods_correctly_recognize_generic_upper_bound.dart:26:77: Error: Type argument 'dart.core::int' violates the corresponding type variable bound of 'Foo<dart.core::String>::method'. |
| // Try changing type arguments so that they conform to the bounds. |
| // . /*error:COULD_NOT_INFER*/ /*@typeArgs=int*/ /*@target=Foo::method*/ method( |
| // ^ |
| |
| // Unhandled errors: |
| // |
| // pkg/front_end/testcases/inference/generic_methods_correctly_recognize_generic_upper_bound.dart:26:77: Error: Inferred type argument 'dart.core::int' violates the corresponding type variable bound of 'Foo<dart.core::String>::method'. |
| // Try specifying type arguments explicitly so that they conform to the bounds. |
| // . /*error:COULD_NOT_INFER*/ /*@typeArgs=int*/ /*@target=Foo::method*/ method( |
| // ^ |
| // |
| // pkg/front_end/testcases/inference/generic_methods_correctly_recognize_generic_upper_bound.dart:26:77: Error: Type argument 'dart.core::int' violates the corresponding type variable bound of 'Foo<dart.core::String>::method'. |
| // Try changing type arguments so that they conform to the bounds. |
| // . /*error:COULD_NOT_INFER*/ /*@typeArgs=int*/ /*@target=Foo::method*/ method( |
| // ^ |
| |
| library test; |
| import self as self; |
| import "dart:core" as core; |
| |
| class Foo<T extends core::Pattern = core::Pattern> extends core::Object { |
| synthetic constructor •() → self::Foo<self::Foo::T> |
| : super core::Object::•() |
| ; |
| method method<generic-covariant-impl U extends self::Foo::T = 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); |
| } |