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

Issue 15409004: Update CONST_CONSTRUCTOR_WITH_NON_FINAL_FIELD to check also super/mixin types (Closed)

Created:
7 years, 7 months ago by scheglov
Modified:
7 years, 7 months ago
Reviewers:
jwren, Brian Wilkerson
CC:
reviews_dartlang.org, lukeechurch_gmail.com
Visibility:
Public.

Description

Update CONST_CONSTRUCTOR_WITH_NON_FINAL_FIELD to check also super/mixin types R=brianwilkerson@google.com BUG= Committed: https://code.google.com/p/dart/source/detail?r=22887

Patch Set 1 #

Total comments: 4

Patch Set 2 : Move hasNonFinalField() to ClassElement #

Messages

Total messages: 4 (0 generated)
scheglov
7 years, 7 months ago (2013-05-18 05:57:16 UTC) #1
Brian Wilkerson
LGTM https://codereview.chromium.org/15409004/diff/1/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/error/CompileTimeErrorCode.java File editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/error/CompileTimeErrorCode.java (right): https://codereview.chromium.org/15409004/diff/1/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/error/CompileTimeErrorCode.java#newcode131 editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/error/CompileTimeErrorCode.java:131: "Cannot define the 'const' constructor because of the ...
7 years, 7 months ago (2013-05-18 17:03:41 UTC) #2
scheglov
Committed patchset #2 manually as r22887 (presubmit successful).
7 years, 7 months ago (2013-05-19 23:38:06 UTC) #3
scheglov
7 years, 7 months ago (2013-05-19 23:38:50 UTC) #4
Message was sent while issue was closed.
https://codereview.chromium.org/15409004/diff/1/editor/tools/plugins/com.goog...
File
editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/error/CompileTimeErrorCode.java
(right):

https://codereview.chromium.org/15409004/diff/1/editor/tools/plugins/com.goog...
editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/error/CompileTimeErrorCode.java:131:
"Cannot define the 'const' constructor because of the non-final field '%s'"),
On 2013/05/18 17:03:41, Brian Wilkerson wrote:
> Given that there can be multiple non-final fields, I think it would be better
to
> make the message more generic, perhaps something like "Cannot define a 'const'
> constructor because '%s' defines one or more non-final fields"

Well, IMHO reporting just one non-final field is better than being correct, but
not helpful.
OTOH, for using in the editor it may be enough, user can use Class Hierarchy to
find the non-final field(s).

https://codereview.chromium.org/15409004/diff/1/editor/tools/plugins/com.goog...
File
editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/verifier/ErrorVerifier.java
(right):

https://codereview.chromium.org/15409004/diff/1/editor/tools/plugins/com.goog...
editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/verifier/ErrorVerifier.java:150:
private static FieldElement findNotFinalField(ClassElement classElement) {
On 2013/05/18 17:03:41, Brian Wilkerson wrote:
> This method could then return a boolean value, should be renamed to something
> like hasNonFinalField(), and should be moved to ClassElement.

Done.

Powered by Google App Engine
This is Rietveld 408576698