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

Unified Diff: pkg/analyzer/test/src/task/strong/inferred_type_test.dart

Issue 2342883004: Issue 27367. Fix linking when setter overrides a field. (Closed)
Patch Set: Created 4 years, 3 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 | « pkg/analyzer/lib/src/summary/link.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/src/task/strong/inferred_type_test.dart
diff --git a/pkg/analyzer/test/src/task/strong/inferred_type_test.dart b/pkg/analyzer/test/src/task/strong/inferred_type_test.dart
index 85ee428d6c14cad827bb593b7b1c9e934865174d..0e4e5b0539004f787ff7cd4e866a443ac3f0b256 100644
--- a/pkg/analyzer/test/src/task/strong/inferred_type_test.dart
+++ b/pkg/analyzer/test/src/task/strong/inferred_type_test.dart
@@ -2807,6 +2807,32 @@ main() {
expect(fns[9].type.toString(), '() → Stream<int>');
}
+ void test_inferParameterType_setter_fromField() {
+ var mainUnit = checkFile('''
+class C extends D {
+ /*error:INVALID_FIELD_OVERRIDE*/set foo(x) {}
+}
+class D {
+ int foo;
+}
+''');
+ var f = mainUnit.getType('C').accessors[0];
+ expect(f.type.toString(), '(int) → void');
+ }
+
+ void test_inferParameterType_setter_fromSetter() {
+ var mainUnit = checkFile('''
+class C extends D {
+ set foo(x) {}
+}
+class D {
+ set foo(int x) {}
+}
+''');
+ var f = mainUnit.getType('C').accessors[0];
+ expect(f.type.toString(), '(int) → void');
+ }
+
void test_inferred_nonstatic_field_depends_on_static_field_complex() {
var mainUnit = checkFile('''
class C {
« no previous file with comments | « pkg/analyzer/lib/src/summary/link.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698