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

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

Issue 1015843002: Turn on infer-from-overrides by default, rename inferStaticFromOtherStatics to (Closed) Base URL: git@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
« no previous file with comments | « lib/src/options.dart ('k') | test/checker/inferred_type_test.dart » ('j') | 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) 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
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, 52 covariantGenerics: true, relaxedCasts: true,
53 inferFromOverrides: ResolverOptions.inferFromOverridesDefault, 53 inferFromOverrides: ResolverOptions.inferFromOverridesDefault,
54 inferStaticsFromIdentifiers: ResolverOptions.inferStaticsFromIdentifiersDefa ult, 54 inferTransitively: ResolverOptions.inferTransitivelyDefault,
55 nonnullableTypes: TypeOptions.NONNULLABLE_TYPES}) { 55 nonnullableTypes: TypeOptions.NONNULLABLE_TYPES}) {
56 expect(testFiles.containsKey('/main.dart'), isTrue, 56 expect(testFiles.containsKey('/main.dart'), isTrue,
57 reason: '`/main.dart` is missing in testFiles'); 57 reason: '`/main.dart` is missing in testFiles');
58 58
59 // Create a resolver that can load test files from memory. 59 // Create a resolver that can load test files from memory.
60 var testUriResolver = new TestUriResolver(testFiles); 60 var testUriResolver = new TestUriResolver(testFiles);
61 var options = new CompilerOptions( 61 var options = new CompilerOptions(
62 allowConstCasts: allowConstCasts, 62 allowConstCasts: allowConstCasts,
63 covariantGenerics: covariantGenerics, 63 covariantGenerics: covariantGenerics,
64 relaxedCasts: relaxedCasts, 64 relaxedCasts: relaxedCasts,
65 inferFromOverrides: inferFromOverrides, 65 inferFromOverrides: inferFromOverrides,
66 inferStaticsFromIdentifiers: inferStaticsFromIdentifiers, 66 inferTransitively: inferTransitively,
67 nonnullableTypes: nonnullableTypes, 67 nonnullableTypes: nonnullableTypes,
68 useMockSdk: sdkDir == null, 68 useMockSdk: sdkDir == null,
69 dartSdkPath: sdkDir, 69 dartSdkPath: sdkDir,
70 entryPointFile: '/main.dart'); 70 entryPointFile: '/main.dart');
71 var resolver = sdkDir == null 71 var resolver = sdkDir == null
72 ? new TypeResolver.fromMock(mockSdkSources, options, 72 ? new TypeResolver.fromMock(mockSdkSources, options,
73 otherResolvers: [testUriResolver]) 73 otherResolvers: [testUriResolver])
74 : new TypeResolver.fromDir(sdkDir, options, 74 : new TypeResolver.fromDir(sdkDir, options,
75 otherResolvers: [testUriResolver]); 75 otherResolvers: [testUriResolver]);
76 76
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 327
328 SourceSpan spanFor(AstNode node) { 328 SourceSpan spanFor(AstNode node) {
329 final begin = node is AnnotatedNode 329 final begin = node is AnnotatedNode
330 ? node.firstTokenAfterCommentAndMetadata.offset 330 ? node.firstTokenAfterCommentAndMetadata.offset
331 : node.offset; 331 : node.offset;
332 return _file.span(begin, node.end); 332 return _file.span(begin, node.end);
333 } 333 }
334 334
335 String toString() => '[$runtimeType: $uri]'; 335 String toString() => '[$runtimeType: $uri]';
336 } 336 }
OLDNEW
« no previous file with comments | « lib/src/options.dart ('k') | test/checker/inferred_type_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698