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

Issue 10825190: Don't infer non-final field types (Closed)

Created:
8 years, 4 months ago by scheglov
Modified:
8 years, 4 months ago
Reviewers:
Brian Wilkerson
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Don't infer non-final field types We can not analyze universe and prove that field is not reassigned to have value of othe type. R=brianwilkerson@google.com BUG= Committed: https://code.google.com/p/dart/source/detail?r=10260

Patch Set 1 #

Total comments: 4

Patch Set 2 : Tests for 'const' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+212 lines, -53 lines) Patch
M compiler/java/com/google/dart/compiler/resolver/Resolver.java View 1 chunk +1 line, -1 line 0 comments Download
M compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java View 2 chunks +9 lines, -6 lines 0 comments Download
M compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java View 1 2 chunks +56 lines, -8 lines 0 comments Download
M editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/internal/corext/SourceRangeFactory.java View 3 chunks +21 lines, -0 lines 0 comments Download
M editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/internal/corext/refactoring/code/ExtractLocalRefactoring.java View 2 chunks +2 lines, -2 lines 0 comments Download
M editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/internal/corext/refactoring/code/ExtractMethodRefactoring.java View 1 chunk +1 line, -1 line 0 comments Download
M editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/internal/corext/refactoring/code/ExtractUtils.java View 1 4 chunks +7 lines, -22 lines 0 comments Download
A editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/internal/corext/refactoring/code/TokenUtils.java View 1 chunk +67 lines, -0 lines 0 comments Download
M editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/text/correction/QuickAssistProcessor.java View 4 chunks +39 lines, -13 lines 0 comments Download
M editor/tools/plugins/com.google.dart.tools.ui_test/src/com/google/dart/tools/ui/correction/QuickAssistProcessorTest.java View 2 chunks +9 lines, -0 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
scheglov
8 years, 4 months ago (2012-08-03 21:42:06 UTC) #1
Brian Wilkerson
LGTM https://chromiumcodereview.appspot.com/10825190/diff/1/compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java File compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java (right): https://chromiumcodereview.appspot.com/10825190/diff/1/compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java#newcode2528 compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java:2528: if (node.getModifiers().isFinal()) { You might also want to ...
8 years, 4 months ago (2012-08-03 21:53:07 UTC) #2
scheglov
8 years, 4 months ago (2012-08-03 22:08:20 UTC) #3
https://chromiumcodereview.appspot.com/10825190/diff/1/compiler/java/com/goog...
File compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java (right):

https://chromiumcodereview.appspot.com/10825190/diff/1/compiler/java/com/goog...
compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java:2528: if
(node.getModifiers().isFinal()) {
On 2012/08/03 21:53:07, Brian Wilkerson wrote:
> You might also want to include const fields because they're implicitly final.
I
> don't think we accept them yet, but when we do this code won't need to be
> updated.

I've added tests for "const".
But actually we don't need to check for "const" separately, because every const
is marked as "final" in parser.

https://chromiumcodereview.appspot.com/10825190/diff/1/editor/tools/plugins/c...
File
editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/internal/corext/refactoring/code/ExtractUtils.java
(right):

https://chromiumcodereview.appspot.com/10825190/diff/1/editor/tools/plugins/c...
editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/internal/corext/refactoring/code/ExtractUtils.java:394:
// XXX
On 2012/08/03 21:53:07, Brian Wilkerson wrote:
> Did you intend to include this in the CL? (No response required, just drawing
> attention to it.)

Ah... Thank you!

Powered by Google App Engine
This is Rietveld 408576698