blob: 97c531dd6a5714ae1a2a25b9fc2109a47a966e79 [file] [log] [blame]
library;
//
// Problems in library:
//
// pkg/front_end/testcases/general/bug33298.dart:20:47: Error: A value of type 'List<dynamic>' can't be assigned to a variable of type 'List<String>'.
// - 'List' is from 'dart:core'.
// List<String> list2 = ['a', 'b', 'c'].map(a).toList();
// ^
//
// pkg/front_end/testcases/general/bug33298.dart:24:47: Error: A value of type 'List<dynamic>' can't be assigned to a variable of type 'List<String>'.
// - 'List' is from 'dart:core'.
// List<String> list4 = ['a', 'b', 'c'].map(b).toList();
// ^
//
// pkg/front_end/testcases/general/bug33298.dart:28:47: Error: A value of type 'List<dynamic>' can't be assigned to a variable of type 'List<String>'.
// - 'List' is from 'dart:core'.
// List<String> list6 = ['a', 'b', 'c'].map(c).toList();
// ^
//
import self as self;
import "dart:core" as core;
class A extends core::Object {
synthetic constructor •() self::A
: super core::Object::•()
;
method call(core::String s) core::String
return "${s}${s}";
}
class B<T extends core::Object? = dynamic> extends core::Object {
synthetic constructor •() self::B<self::B::T%>
: super core::Object::•()
;
method call(covariant-by-class self::B::T% t) self::B::T%
return t;
}
class C extends core::Object {
synthetic constructor •() self::C
: super core::Object::•()
;
method call<T extends core::Object? = dynamic>(self::C::call::T% t) self::C::call::T%
return t;
}
static method test() dynamic {
self::A a = new self::A::•();
core::List<core::String> list1 = <core::String>["a", "b", "c"].{core::Iterable::map}<core::String>(a.{self::A::call}{(core::String) core::String}){((core::String) core::String) core::Iterable<core::String>}.{core::Iterable::toList}(){({growable: core::bool}) core::List<core::String>};
core::List<core::String> list2 = invalid-expression "pkg/front_end/testcases/general/bug33298.dart:20:47: Error: A value of type 'List<dynamic>' can't be assigned to a variable of type 'List<String>'.
- 'List' is from 'dart:core'.
List<String> list2 = ['a', 'b', 'c'].map(a).toList();
^" in <core::String>["a", "b", "c"].{core::Iterable::map}<dynamic>(let final self::A #t1 = a in #t1 == null ?{(core::String) → core::String} null : #t1.{self::A::call}{(core::String) → core::String}){((core::String) → dynamic) → core::Iterable<dynamic>}.{core::Iterable::toList}(){({growable: core::bool}) → core::List<dynamic>} as{TypeError} core::List<core::String>;
self::B<core::String> b = new self::B::•<core::String>();
core::List<core::String> list3 = <core::String>["a", "b", "c"].{core::Iterable::map}<core::String>(b.{self::B::call}{(core::String) core::String} as{TypeError,CovarianceCheck} (core::String) core::String){((core::String) core::String) core::Iterable<core::String>}.{core::Iterable::toList}(){({growable: core::bool}) core::List<core::String>};
core::List<core::String> list4 = invalid-expression "pkg/front_end/testcases/general/bug33298.dart:24:47: Error: A value of type 'List<dynamic>' can't be assigned to a variable of type 'List<String>'.
- 'List' is from 'dart:core'.
List<String> list4 = ['a', 'b', 'c'].map(b).toList();
^" in <core::String>["a", "b", "c"].{core::Iterable::map}<dynamic>(let final self::B<core::String> #t2 = b in #t2 == null ?{(core::String) → core::String} null : #t2.{self::B::call}{(core::String) → core::String}){((core::String) → dynamic) → core::Iterable<dynamic>}.{core::Iterable::toList}(){({growable: core::bool}) → core::List<dynamic>} as{TypeError} core::List<core::String>;
self::C c = new self::C::•();
core::List<core::String> list5 = <core::String>["a", "b", "c"].{core::Iterable::map}<core::String>(c.{self::C::call}{<T extends core::Object? = dynamic>(T%) T%}<core::String>){((core::String) core::String) core::Iterable<core::String>}.{core::Iterable::toList}(){({growable: core::bool}) core::List<core::String>};
core::List<core::String> list6 = invalid-expression "pkg/front_end/testcases/general/bug33298.dart:28:47: Error: A value of type 'List<dynamic>' can't be assigned to a variable of type 'List<String>'.
- 'List' is from 'dart:core'.
List<String> list6 = ['a', 'b', 'c'].map(c).toList();
^" in <core::String>["a", "b", "c"].{core::Iterable::map}<dynamic>((let final self::C #t3 = c in #t3 == null ?{<T extends core::Object? = dynamic>(T%) → T%} null : #t3.{self::C::call}{<T extends core::Object? = dynamic>(T%) → T%})<core::String>){((core::String) → dynamic) → core::Iterable<dynamic>}.{core::Iterable::toList}(){({growable: core::bool}) → core::List<dynamic>} as{TypeError} core::List<core::String>;
}
static method main() dynamic {}