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

Unified Diff: pkg/kernel/testcases/spec-mode/covariant_generic.baseline.txt

Issue 2618393002: Insert covariance checks in strong mode. (Closed)
Patch Set: Merge Created 3 years, 11 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
Index: pkg/kernel/testcases/spec-mode/covariant_generic.baseline.txt
diff --git a/pkg/kernel/testcases/spec-mode/covariant_generic.baseline.txt b/pkg/kernel/testcases/spec-mode/covariant_generic.baseline.txt
new file mode 100644
index 0000000000000000000000000000000000000000..063394e175dbe510d583de36efe92a4bea695fc5
--- /dev/null
+++ b/pkg/kernel/testcases/spec-mode/covariant_generic.baseline.txt
@@ -0,0 +1,38 @@
+library;
+import self as self;
+import "dart:core" as core;
+
+class Foo<T extends core::Object> extends core::Object {
+ final field self::Foo::T finalField;
+ final field (self::Foo::T) → void callbackField;
+ field self::Foo::T mutableField = null;
+ field (self::Foo::T) → void mutableCallbackField = null;
+ constructor •(self::Foo::T finalField, (self::Foo::T) → void callbackField) → void
+ : self::Foo::finalField = finalField, self::Foo::callbackField = callbackField, super core::Object::•()
+ ;
+ method method(self::Foo::T x) → void {}
+ set setter(self::Foo::T x) → dynamic {}
+ method withCallback((self::Foo::T) → void callback) → void {
+ callback.call(this.finalField);
+ }
+}
+static method main() → dynamic {
+ self::Foo<core::int> fooInt = new self::Foo::•<core::int>(1, (core::int x) → dynamic {});
+ fooInt.method(3);
+ fooInt.setter = 3;
+ fooInt.withCallback((core::int x) → dynamic {});
+ fooInt.withCallback((core::num x) → dynamic {});
+ fooInt.mutableField = 3;
+ fooInt.mutableCallbackField = (core::int x) → dynamic {};
+ self::Foo<core::num> fooNum = fooInt;
+ fooNum.method(3);
+ fooNum.method(2.5);
+ fooNum.setter = 3;
+ fooNum.setter = 2.5;
+ fooNum.withCallback((core::num x) → dynamic {});
+ fooNum.mutableField = 3;
+ fooNum.mutableField = 2.5;
+ fooNum.mutableCallbackField(3);
+ fooNum.mutableCallbackField(2.5);
+ fooNum.mutableCallbackField = (core::num x) → dynamic {};
+}
« no previous file with comments | « pkg/kernel/testcases/input/covariant_generic.dart ('k') | pkg/kernel/testcases/strong-mode/DeltaBlue.baseline.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698