Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(572)

Unified Diff: pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_tear_off.dart

Issue 2995383002: Beef up the covariant generic parameter tear off test case (Closed)
Patch Set: Fix test Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_tear_off.dart.direct.expect » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_tear_off.dart
diff --git a/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_tear_off.dart b/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_tear_off.dart
index ecc944d8372ca27db1f31495d2a2513bb85fbbe6..e48b38b4b13df11bf234d75260a15b99a45a220a 100644
--- a/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_tear_off.dart
+++ b/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_tear_off.dart
@@ -7,12 +7,15 @@ library test;
typedef void F<T>(T x);
+typedef U G<T, U>(T x);
+
class C<T> {
- void f(T /*@checkFormal=semiSafe*/ x) {}
+ void f1(T /*@checkFormal=semiSafe*/ x) {}
+ T f2(List<T> /*@checkFormal=semiSafe*/ x) => x.first;
}
-void g1(C<num> c) {
- c.f;
+F<num> g1(C<num> c) {
+ return c.f1;
}
void g2(C<int> c, Object x) {
@@ -20,9 +23,14 @@ void g2(C<int> c, Object x) {
f /*@checkCall=interface(semiTyped:0)*/ (x);
}
+G<List<num>, num> g3(C<num> c) {
+ return c.f2;
+}
+
void test() {
var x = g1(new C<int>());
x /*@checkCall=interface(semiTyped:0)*/ (1.5);
+ g3(new C<int>());
}
main() {}
« no previous file with comments | « no previous file | pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_tear_off.dart.direct.expect » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698