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

Unified Diff: lib/strong_mode.dart

Issue 1355893003: Rewire DDC to use the analyzer task model (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: Update pubspec Created 5 years, 2 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
« no previous file with comments | « lib/src/dart_sdk.dart ('k') | pubspec.yaml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/strong_mode.dart
diff --git a/lib/strong_mode.dart b/lib/strong_mode.dart
index 16fbdf8f141822ddb55a60324b2ed62e6ea572ad..9565b83107dd707b357d9a518553476c7b4faf4d 100644
--- a/lib/strong_mode.dart
+++ b/lib/strong_mode.dart
@@ -7,7 +7,12 @@
library dev_compiler.strong_mode;
import 'package:analyzer/src/generated/engine.dart'
- show AnalysisContextImpl, AnalysisErrorInfo, AnalysisErrorInfoImpl;
+ show
+ AnalysisContext,
+ AnalysisContextImpl,
+ AnalysisEngine,
+ AnalysisErrorInfo,
+ AnalysisErrorInfoImpl;
import 'package:analyzer/src/generated/error.dart'
show
AnalysisError,
@@ -27,15 +32,17 @@ import 'src/checker/rules.dart' show RestrictedRules;
/// A type checker for Dart code that operates under stronger rules, and has
/// the ability to do local type inference in some situations.
class StrongChecker {
- final AnalysisContextImpl _context;
+ final AnalysisContext _context;
final CodeChecker _checker;
final _ErrorCollector _reporter;
StrongChecker._(this._context, this._checker, this._reporter);
- factory StrongChecker(
- AnalysisContextImpl context, StrongModeOptions options) {
- enableDevCompilerInference(context, options);
+ factory StrongChecker(AnalysisContext context, StrongModeOptions options) {
+ // TODO(vsm): Remove this once analyzer_cli is completely switched to the
+ // task model.
+ if (!AnalysisEngine
+ .instance.useTaskModel) enableDevCompilerInference(context, options);
var rules = new RestrictedRules(context.typeProvider, options: options);
var reporter = new _ErrorCollector(options.hints);
var checker = new CodeChecker(rules, reporter, options);
« no previous file with comments | « lib/src/dart_sdk.dart ('k') | pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698