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

Unified Diff: test/rules/must_call_super.dart

Issue 1767843002: Lint for `@mustCallSuper` (#194). (Closed) Base URL: https://github.com/dart-lang/linter.git@master
Patch Set: Created 4 years, 10 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 | « pubspec.yaml ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/rules/must_call_super.dart
diff --git a/test/rules/must_call_super.dart b/test/rules/must_call_super.dart
new file mode 100644
index 0000000000000000000000000000000000000000..637c6f5725da5718306e2f9a04b056a1a121da05
--- /dev/null
+++ b/test/rules/must_call_super.dart
@@ -0,0 +1,31 @@
+// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// test w/ `dart test/util/solo_test.dart must_call_super`
+
+import 'package:meta/meta.dart';
+
+class A {
+ @mustCallSuper
+ void a() {}
+}
+
+class B extends A {
+ @override
+ void a() //LINT
+ {}
+}
+
+class C extends A {
+ @override
+ void a() {
+ super.a(); //OK
+ }
+}
+
+class D extends C {
+ @override
+ void a() //LINT
+ {}
+}
« no previous file with comments | « pubspec.yaml ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698