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

Unified Diff: compiler/java/com/google/dart/compiler/resolver/Resolver.java

Issue 10825190: Don't infer non-final field types (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Tests for 'const' Created 8 years, 4 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 | compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: compiler/java/com/google/dart/compiler/resolver/Resolver.java
diff --git a/compiler/java/com/google/dart/compiler/resolver/Resolver.java b/compiler/java/com/google/dart/compiler/resolver/Resolver.java
index b4032c80774563a965aebc55083be4f582307409..47e668d8d47e0901a2bae46cae5f1b74e9e539b9 100644
--- a/compiler/java/com/google/dart/compiler/resolver/Resolver.java
+++ b/compiler/java/com/google/dart/compiler/resolver/Resolver.java
@@ -679,7 +679,7 @@ public class Resolver {
// Now, this constant has a type. Save it for future reference.
Element element = node.getElement();
Type expressionType = expression.getType();
- if (expressionType != null && TypeKind.of(element.getType()) == TypeKind.DYNAMIC) {
+ if (isFinal && expressionType != null && TypeKind.of(element.getType()) == TypeKind.DYNAMIC) {
Type fieldType = Types.makeInferred(expressionType);
Elements.setType(element, fieldType);
}
« no previous file with comments | « no previous file | compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698