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

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

Issue 1262163002: Implement DEP 34 (less restricted mixins) in analysis engine. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 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 unified diff | Download patch
« no previous file with comments | « pkg/analyzer/test/generated/engine_test.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 engine.non_error_resolver_test; 5 library engine.non_error_resolver_test;
6 6
7 import 'package:analyzer/src/generated/ast.dart'; 7 import 'package:analyzer/src/generated/ast.dart';
8 import 'package:analyzer/src/generated/element.dart'; 8 import 'package:analyzer/src/generated/element.dart';
9 import 'package:analyzer/src/generated/engine.dart';
9 import 'package:analyzer/src/generated/error.dart'; 10 import 'package:analyzer/src/generated/error.dart';
10 import 'package:analyzer/src/generated/parser.dart' show ParserErrorCode; 11 import 'package:analyzer/src/generated/parser.dart' show ParserErrorCode;
11 import 'package:analyzer/src/generated/source_io.dart'; 12 import 'package:analyzer/src/generated/source_io.dart';
12 import 'package:unittest/unittest.dart' as _ut; 13 import 'package:unittest/unittest.dart' as _ut;
13 14
14 import '../reflective_tests.dart'; 15 import '../reflective_tests.dart';
15 import 'resolver_test.dart'; 16 import 'resolver_test.dart';
16 import 'test_support.dart'; 17 import 'test_support.dart';
17 18
18 main() { 19 main() {
(...skipping 3113 matching lines...) Expand 10 before | Expand all | Expand 10 after
3132 Source source = addSource(r''' 3133 Source source = addSource(r'''
3133 class A { 3134 class A {
3134 factory A() {} 3135 factory A() {}
3135 } 3136 }
3136 class B extends Object with A {}'''); 3137 class B extends Object with A {}''');
3137 computeLibrarySourceErrors(source); 3138 computeLibrarySourceErrors(source);
3138 assertNoErrors(source); 3139 assertNoErrors(source);
3139 verify([source]); 3140 verify([source]);
3140 } 3141 }
3141 3142
3143 void test_mixinInheritsFromNotObject_classDeclaration_extends() {
3144 AnalysisOptionsImpl options = new AnalysisOptionsImpl();
3145 options.enableSuperMixins = true;
3146 resetWithOptions(options);
3147 Source source = addSource(r'''
3148 class A {}
3149 class B extends A {}
3150 class C extends Object with B {}''');
3151 computeLibrarySourceErrors(source);
3152 assertNoErrors(source);
3153 verify([source]);
3154 }
3155
3142 void test_mixinInheritsFromNotObject_classDeclaration_mixTypeAlias() { 3156 void test_mixinInheritsFromNotObject_classDeclaration_mixTypeAlias() {
3143 Source source = addSource(r''' 3157 Source source = addSource(r'''
3144 class A {} 3158 class A {}
3145 class B = Object with A; 3159 class B = Object with A;
3146 class C extends Object with B {}'''); 3160 class C extends Object with B {}''');
3147 computeLibrarySourceErrors(source); 3161 computeLibrarySourceErrors(source);
3148 assertNoErrors(source); 3162 assertNoErrors(source);
3149 verify([source]); 3163 verify([source]);
3150 } 3164 }
3151 3165
3166 void test_mixinInheritsFromNotObject_classDeclaration_with() {
3167 AnalysisOptionsImpl options = new AnalysisOptionsImpl();
3168 options.enableSuperMixins = true;
3169 resetWithOptions(options);
3170 Source source = addSource(r'''
3171 class A {}
3172 class B extends Object with A {}
3173 class C extends Object with B {}''');
3174 computeLibrarySourceErrors(source);
3175 assertNoErrors(source);
3176 verify([source]);
3177 }
3178
3179 void test_mixinInheritsFromNotObject_typeAlias_extends() {
3180 AnalysisOptionsImpl options = new AnalysisOptionsImpl();
3181 options.enableSuperMixins = true;
3182 resetWithOptions(options);
3183 Source source = addSource(r'''
3184 class A {}
3185 class B extends A {}
3186 class C = Object with B;''');
3187 computeLibrarySourceErrors(source);
3188 assertNoErrors(source);
3189 verify([source]);
3190 }
3191
3192 void test_mixinInheritsFromNotObject_typeAlias_with() {
3193 AnalysisOptionsImpl options = new AnalysisOptionsImpl();
3194 options.enableSuperMixins = true;
3195 resetWithOptions(options);
3196 Source source = addSource(r'''
3197 class A {}
3198 class B extends Object with A {}
3199 class C = Object with B;''');
3200 computeLibrarySourceErrors(source);
3201 assertNoErrors(source);
3202 verify([source]);
3203 }
3204
3152 void test_mixinInheritsFromNotObject_typedef_mixTypeAlias() { 3205 void test_mixinInheritsFromNotObject_typedef_mixTypeAlias() {
3153 Source source = addSource(r''' 3206 Source source = addSource(r'''
3154 class A {} 3207 class A {}
3155 class B = Object with A; 3208 class B = Object with A;
3156 class C = Object with B;'''); 3209 class C = Object with B;''');
3157 computeLibrarySourceErrors(source); 3210 computeLibrarySourceErrors(source);
3158 assertNoErrors(source); 3211 assertNoErrors(source);
3159 verify([source]); 3212 verify([source]);
3160 } 3213 }
3161 3214
3215 void test_mixinReferencesSuper() {
3216 AnalysisOptionsImpl options = new AnalysisOptionsImpl();
3217 options.enableSuperMixins = true;
3218 resetWithOptions(options);
3219 Source source = addSource(r'''
3220 class A {
3221 toString() => super.toString();
3222 }
3223 class B extends Object with A {}''');
3224 computeLibrarySourceErrors(source);
3225 assertNoErrors(source);
3226 verify([source]);
3227 }
3228
3162 void test_multipleSuperInitializers_no() { 3229 void test_multipleSuperInitializers_no() {
3163 Source source = addSource(r''' 3230 Source source = addSource(r'''
3164 class A {} 3231 class A {}
3165 class B extends A { 3232 class B extends A {
3166 B() {} 3233 B() {}
3167 }'''); 3234 }''');
3168 computeLibrarySourceErrors(source); 3235 computeLibrarySourceErrors(source);
3169 assertNoErrors(source); 3236 assertNoErrors(source);
3170 verify([source]); 3237 verify([source]);
3171 } 3238 }
(...skipping 2363 matching lines...) Expand 10 before | Expand all | Expand 10 after
5535 reset(); 5602 reset();
5536 } 5603 }
5537 5604
5538 void _check_wrongNumberOfParametersForOperator1(String name) { 5605 void _check_wrongNumberOfParametersForOperator1(String name) {
5539 _check_wrongNumberOfParametersForOperator(name, "a"); 5606 _check_wrongNumberOfParametersForOperator(name, "a");
5540 } 5607 }
5541 5608
5542 CompilationUnit _getResolvedLibraryUnit(Source source) => 5609 CompilationUnit _getResolvedLibraryUnit(Source source) =>
5543 analysisContext.getResolvedCompilationUnit2(source, source); 5610 analysisContext.getResolvedCompilationUnit2(source, source);
5544 } 5611 }
OLDNEW
« no previous file with comments | « pkg/analyzer/test/generated/engine_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698