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

Unified Diff: pkg/analyzer/test/generated/hint_code_test.dart

Issue 3007873002: Ensure mustCallSuper check visits children (flutter#11646). (Closed)
Patch Set: 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 | « pkg/analyzer/lib/src/generated/error_verifier.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/generated/hint_code_test.dart
diff --git a/pkg/analyzer/test/generated/hint_code_test.dart b/pkg/analyzer/test/generated/hint_code_test.dart
index 0456fede20cc137467816826238bf4319292df5f..8a9071798b04181956e1eb67110100f4173c6d05 100644
--- a/pkg/analyzer/test/generated/hint_code_test.dart
+++ b/pkg/analyzer/test/generated/hint_code_test.dart
@@ -2148,6 +2148,53 @@ class C extends A {
verify([source]);
}
+ //https://github.com/flutter/flutter/issues/11646
Brian Wilkerson 2017/08/30 20:34:23 Please move this and similar comments inside the a
pquitslund 2017/08/30 20:42:13 Ah, yes! Forgot about that. Will do.
+ test_mustCallSuper_overridden_w_future() async {
+ Source source = addSource(r'''
+import 'dart:async';
+import 'package:meta/meta.dart';
+class A {
+ @mustCallSuper
+ Future<Null> bar() => new Future<Null>.value();
+}
+class C extends A {
+ @override
+ Future<Null> bar() {
+ final value = super.bar();
+ return value.then((Null _) {
+ return null;
+ });
+ }
+}
+''');
+ await computeAnalysisResult(source);
+ assertErrors(source, []);
+ verify([source]);
+ }
+
+ //https://github.com/flutter/flutter/issues/11646
+ test_mustCallSuper_overridden_w_future2() async {
+ Source source = addSource(r'''
+import 'dart:async';
+import 'package:meta/meta.dart';
+class A {
+ @mustCallSuper
+ Future<Null> bar() => new Future<Null>.value();
+}
+class C extends A {
+ @override
+ Future<Null> bar() {
+ return super.bar().then((Null _) {
+ return null;
+ });
+ }
+}
+''');
+ await computeAnalysisResult(source);
+ assertErrors(source, []);
+ verify([source]);
+ }
+
test_nullAwareInCondition_assert() async {
Source source = addSource(r'''
m(x) {
« no previous file with comments | « pkg/analyzer/lib/src/generated/error_verifier.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698