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

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

Issue 2837173002: fix #29426, class type alias was missing checks (Closed)
Patch Set: Created 3 years, 8 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/analyzer/test/generated/static_warning_code_test.dart
diff --git a/pkg/analyzer/test/generated/static_warning_code_test.dart b/pkg/analyzer/test/generated/static_warning_code_test.dart
index b6aecefafddd634ebadb3be7ca727b94d563c04d..6b26293bd99c8c32bb6859de39c2e861f62b6fa0 100644
--- a/pkg/analyzer/test/generated/static_warning_code_test.dart
+++ b/pkg/analyzer/test/generated/static_warning_code_test.dart
@@ -1526,6 +1526,53 @@ class B implements A {
verify([source]);
}
+ test_functionWithoutCall_mixin_implements() async {
+ Source source = addSource(r'''
+abstract class A implements Function {}
+class B extends Object with A {}''');
+ await computeAnalysisResult(source);
+ assertErrors(source, [StaticWarningCode.FUNCTION_WITHOUT_CALL]);
+ verify([source]);
+ }
+
+ test_functionWithoutCall_direct_typeAlias() async {
+ Source source = addSource(r'''
+class M {}
+class A = Object with M implements Function;''');
+ await computeAnalysisResult(source);
+ assertErrors(source, [StaticWarningCode.FUNCTION_WITHOUT_CALL]);
+ verify([source]);
+ }
+
+ test_functionWithoutCall_indirect_extends_typeAlias() async {
+ Source source = addSource(r'''
+abstract class A implements Function {}
+class M {}
+class B = A with M;''');
+ await computeAnalysisResult(source);
+ assertErrors(source, [StaticWarningCode.FUNCTION_WITHOUT_CALL]);
+ verify([source]);
+ }
+
+ test_functionWithoutCall_indirect_implements_typeAlias() async {
+ Source source = addSource(r'''
+abstract class A implements Function {}
+class M {}
+class B = Object with M implements A;''');
+ await computeAnalysisResult(source);
+ assertErrors(source, [StaticWarningCode.FUNCTION_WITHOUT_CALL]);
+ verify([source]);
+ }
+
+ test_functionWithoutCall_mixin_implements_typeAlias() async {
+ Source source = addSource(r'''
+abstract class A implements Function {}
+class B = Object with A;''');
+ await computeAnalysisResult(source);
+ assertErrors(source, [StaticWarningCode.FUNCTION_WITHOUT_CALL]);
+ verify([source]);
+ }
+
test_importDuplicatedLibraryNamed() async {
Source source = addSource(r'''
library test;

Powered by Google App Engine
This is Rietveld 408576698