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

Side by Side Diff: pkg/analyzer/test/generated/static_warning_code_test.dart

Issue 1951363003: Report when members indirectly inherited through a mixin are not implemented (issue 26411) (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Fixed test failures Created 4 years, 7 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library analyzer.test.generated.static_warning_code_test; 5 library analyzer.test.generated.static_warning_code_test;
6 6
7 import 'package:analyzer/src/generated/engine.dart';
7 import 'package:analyzer/src/generated/error.dart'; 8 import 'package:analyzer/src/generated/error.dart';
8 import 'package:analyzer/src/generated/source_io.dart'; 9 import 'package:analyzer/src/generated/source_io.dart';
9 import 'package:unittest/unittest.dart'; 10 import 'package:unittest/unittest.dart';
10 11
11 import '../reflective_tests.dart'; 12 import '../reflective_tests.dart';
12 import '../utils.dart'; 13 import '../utils.dart';
13 import 'resolver_test_case.dart'; 14 import 'resolver_test_case.dart';
14 15
15 main() { 16 main() {
16 initializeTestEnvironment(); 17 initializeTestEnvironment();
(...skipping 2838 matching lines...) Expand 10 before | Expand all | Expand 10 after
2855 var v; 2856 var v;
2856 } 2857 }
2857 class C implements I { 2858 class C implements I {
2858 }'''); 2859 }''');
2859 computeLibrarySourceErrors(source); 2860 computeLibrarySourceErrors(source);
2860 assertErrors(source, 2861 assertErrors(source,
2861 [StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_TWO]); 2862 [StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_TWO]);
2862 verify([source]); 2863 verify([source]);
2863 } 2864 }
2864 2865
2866 void
2867 test_nonAbstractClassInheritsAbstractMemberTwo_variable_fromMixin_missingB oth() {
2868 // 26411
2869 resetWithOptions(new AnalysisOptionsImpl()..enableSuperMixins = true);
2870 Source source = addSource(r'''
2871 class A {
2872 int f;
2873 }
2874 class B extends A {}
2875 class C extends Object with B {}
2876 ''');
2877 computeLibrarySourceErrors(source);
2878 assertErrors(source,
2879 [StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_TWO]);
2880 verify([source]);
2881 }
2882
2865 void test_nonTypeInCatchClause_noElement() { 2883 void test_nonTypeInCatchClause_noElement() {
2866 Source source = addSource(r''' 2884 Source source = addSource(r'''
2867 f() { 2885 f() {
2868 try { 2886 try {
2869 } on T catch (e) { 2887 } on T catch (e) {
2870 } 2888 }
2871 }'''); 2889 }''');
2872 computeLibrarySourceErrors(source); 2890 computeLibrarySourceErrors(source);
2873 assertErrors(source, [StaticWarningCode.NON_TYPE_IN_CATCH_CLAUSE]); 2891 assertErrors(source, [StaticWarningCode.NON_TYPE_IN_CATCH_CLAUSE]);
2874 verify([source]); 2892 verify([source]);
(...skipping 781 matching lines...) Expand 10 before | Expand all | Expand 10 after
3656 3674
3657 void test_voidReturnForGetter() { 3675 void test_voidReturnForGetter() {
3658 Source source = addSource(r''' 3676 Source source = addSource(r'''
3659 class S { 3677 class S {
3660 void get value {} 3678 void get value {}
3661 }'''); 3679 }''');
3662 computeLibrarySourceErrors(source); 3680 computeLibrarySourceErrors(source);
3663 assertErrors(source, [StaticWarningCode.VOID_RETURN_FOR_GETTER]); 3681 assertErrors(source, [StaticWarningCode.VOID_RETURN_FOR_GETTER]);
3664 } 3682 }
3665 } 3683 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698