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

Unified Diff: lib/src/checker/resolver.dart

Issue 1088833008: update analyzer to 0.24.4 and remove an old workaround (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 8 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 | « no previous file | pubspec.yaml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/checker/resolver.dart
diff --git a/lib/src/checker/resolver.dart b/lib/src/checker/resolver.dart
index 50b45d4bae2f8179cc590b44c6a7d532d3aa41ee..41d7d21b016e2a989fede5ce6e556ddaaf7879e9 100644
--- a/lib/src/checker/resolver.dart
+++ b/lib/src/checker/resolver.dart
@@ -451,22 +451,6 @@ class RestrictedResolverVisitor extends ResolverVisitor {
super.con1(library, source, typeProvider,
typeAnalyzerFactory: RestrictedStaticTypeAnalyzer.constructor);
- @override
- visitCatchClause(CatchClause node) {
- var stack = node.stackTraceParameter;
- if (stack != null) {
- // TODO(jmesserly): analyzer does not correctly associate StackTrace type.
- // It happens too late in TypeResolverVisitor visitCatchClause.
- var element = stack.staticElement;
- if (element is VariableElementImpl && element.type == null) {
- // From the language spec:
- // The static type of p1 is T and the static type of p2 is StackTrace.
- element.type = _typeProvider.stackTraceType;
- }
- }
- return super.visitCatchClause(node);
- }
-
reanalyzeInitializer(VariableDeclaration variable) {
try {
_revisiting = true;
@@ -708,8 +692,13 @@ class RestrictedStaticTypeAnalyzer extends StaticTypeAnalyzer {
@override // to propagate types to identifiers
visitMethodInvocation(MethodInvocation node) {
- // TODO(sigmund): follow up with analyzer team - why is this needed?
+ // TODO(jmesserly): we rely on having a staticType propagated to the
+ // methodName identifier. This shouldn't be necessary for method calls, so
+ // analyzer doesn't do it by default. Conceptually what we're doing here
+ // is asking for a tear off. We need this until we can fix #132, and rely
+ // on `node.staticElement == null` instead of `rules.isDynamicCall(node)`.
visitSimpleIdentifier(node.methodName);
+
super.visitMethodInvocation(node);
// Search for Object methods.
« no previous file with comments | « no previous file | pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698