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

Side by Side Diff: lib/src/testing.dart

Issue 980103002: Disable infer-from-overrides by default (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 9 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) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 dev_compiler.src.testing; 5 library dev_compiler.src.testing;
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' show TimestampedData; 9 import 'package:analyzer/src/generated/engine.dart' show TimestampedData;
10 import 'package:analyzer/src/generated/source.dart'; 10 import 'package:analyzer/src/generated/source.dart';
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 /// testChecker({ 42 /// testChecker({
43 /// '/main.dart': ''' 43 /// '/main.dart': '''
44 /// testMethod() { 44 /// testMethod() {
45 /// dynamic x = /*warning:Box*/3; 45 /// dynamic x = /*warning:Box*/3;
46 /// } 46 /// }
47 /// ''' 47 /// '''
48 /// }); 48 /// });
49 /// 49 ///
50 CheckerResults testChecker(Map<String, String> testFiles, 50 CheckerResults testChecker(Map<String, String> testFiles,
51 {bool allowConstCasts: true, String sdkDir, CheckerReporter reporter, 51 {bool allowConstCasts: true, String sdkDir, CheckerReporter reporter,
52 covariantGenerics: true, relaxedCasts: true, inferFromOverrides: true, 52 covariantGenerics: true, relaxedCasts: true,
53 inferFromOverrides: ResolverOptions.INFER_FROM_OVERRIDES_DEFAULT,
53 inferStaticsFromIdentifiers: false, inferInNonStableOrder: false, 54 inferStaticsFromIdentifiers: false, inferInNonStableOrder: false,
54 nonnullableTypes: TypeOptions.NONNULLABLE_TYPES}) { 55 nonnullableTypes: TypeOptions.NONNULLABLE_TYPES}) {
55 expect(testFiles.containsKey('/main.dart'), isTrue, 56 expect(testFiles.containsKey('/main.dart'), isTrue,
56 reason: '`/main.dart` is missing in testFiles'); 57 reason: '`/main.dart` is missing in testFiles');
57 58
58 // Create a resolver that can load test files from memory. 59 // Create a resolver that can load test files from memory.
59 var testUriResolver = new TestUriResolver(testFiles); 60 var testUriResolver = new TestUriResolver(testFiles);
60 var options = new CompilerOptions( 61 var options = new CompilerOptions(
61 allowConstCasts: allowConstCasts, 62 allowConstCasts: allowConstCasts,
62 covariantGenerics: covariantGenerics, 63 covariantGenerics: covariantGenerics,
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 321
321 SourceSpan spanFor(AstNode node) { 322 SourceSpan spanFor(AstNode node) {
322 final begin = node is AnnotatedNode 323 final begin = node is AnnotatedNode
323 ? node.firstTokenAfterCommentAndMetadata.offset 324 ? node.firstTokenAfterCommentAndMetadata.offset
324 : node.offset; 325 : node.offset;
325 return _file.span(begin, node.end); 326 return _file.span(begin, node.end);
326 } 327 }
327 328
328 String toString() => '[$runtimeType: $uri]'; 329 String toString() => '[$runtimeType: $uri]';
329 } 330 }
OLDNEW
« lib/src/options.dart ('K') | « lib/src/options.dart ('k') | test/checker/checker_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698