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

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: Created 5 years, 3 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
Index: lib/strong_mode.dart
diff --git a/lib/strong_mode.dart b/lib/strong_mode.dart
index 16fbdf8f141822ddb55a60324b2ed62e6ea572ad..526efee1cdb7c38d6bb48a4b640964e256ecbf39 100644
--- a/lib/strong_mode.dart
+++ b/lib/strong_mode.dart
@@ -7,7 +7,7 @@
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 +27,15 @@ 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);
+ AnalysisContext context, StrongModeOptions options) {
+ 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);

Powered by Google App Engine
This is Rietveld 408576698