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

Issue 8564027: Report errors for default parameter values, issue 351 (Closed)

Created:
9 years, 1 month ago by scheglov
Modified:
9 years, 1 month ago
Reviewers:
zundel
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Patch Set 1 #

Patch Set 2 : Tweaks for tests and other #

Total comments: 9
Unified diffs Side-by-side diffs Delta from patch set Stats (+85 lines, -14 lines) Patch
M compiler/java/com/google/dart/compiler/parser/DartParser.java View 1 8 chunks +43 lines, -9 lines 1 comment Download
M compiler/java/com/google/dart/compiler/parser/ParserErrorCode.java View 1 1 chunk +5 lines, -0 lines 8 comments Download
M compiler/javatests/com/google/dart/compiler/parser/NegativeParserTest.java View 1 1 chunk +35 lines, -0 lines 0 comments Download
M compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerTest.java View 2 chunks +2 lines, -2 lines 0 comments Download
M tests/co19/co19-compiler.status View 2 chunks +0 lines, -2 lines 0 comments Download
M tests/language/language.status View 1 chunk +0 lines, -1 line 0 comments Download

Messages

Total messages: 8 (0 generated)
scheglov
9 years, 1 month ago (2011-11-14 21:37:58 UTC) #1
scheglov
Actually, I'm not satisfied by tests, please don't review until next patch.
9 years, 1 month ago (2011-11-14 21:43:27 UTC) #2
scheglov
9 years, 1 month ago (2011-11-14 21:48:23 UTC) #3
scheglov
OK, patch is ready for review.
9 years, 1 month ago (2011-11-15 14:53:16 UTC) #4
zundel
LGTM other than a few error strings. http://codereview.chromium.org/8564027/diff/4001/compiler/java/com/google/dart/compiler/parser/DartParser.java File compiler/java/com/google/dart/compiler/parser/DartParser.java (right): http://codereview.chromium.org/8564027/diff/4001/compiler/java/com/google/dart/compiler/parser/DartParser.java#newcode988 compiler/java/com/google/dart/compiler/parser/DartParser.java:988: reportError(parameter, ParserErrorCode.EACH_PARAMETER_IS_REQUIRED); ...
9 years, 1 month ago (2011-11-15 16:16:57 UTC) #5
scheglov
http://codereview.chromium.org/8564027/diff/4001/compiler/java/com/google/dart/compiler/parser/ParserErrorCode.java File compiler/java/com/google/dart/compiler/parser/ParserErrorCode.java (right): http://codereview.chromium.org/8564027/diff/4001/compiler/java/com/google/dart/compiler/parser/ParserErrorCode.java#newcode13 compiler/java/com/google/dart/compiler/parser/ParserErrorCode.java:13: DEFAULT_PARAMETER_ABSTRACT("Default values can not be specified in abstract method"), ...
9 years, 1 month ago (2011-11-15 16:33:21 UTC) #6
zundel
http://codereview.chromium.org/8564027/diff/4001/compiler/java/com/google/dart/compiler/parser/ParserErrorCode.java File compiler/java/com/google/dart/compiler/parser/ParserErrorCode.java (right): http://codereview.chromium.org/8564027/diff/4001/compiler/java/com/google/dart/compiler/parser/ParserErrorCode.java#newcode13 compiler/java/com/google/dart/compiler/parser/ParserErrorCode.java:13: DEFAULT_PARAMETER_ABSTRACT("Default values can not be specified in abstract method"), ...
9 years, 1 month ago (2011-11-15 16:36:46 UTC) #7
scheglov
9 years, 1 month ago (2011-11-15 16:45:58 UTC) #8
OK, I've renamed constants to use long version.

http://codereview.chromium.org/8564027/diff/4001/compiler/java/com/google/dar...
File compiler/java/com/google/dart/compiler/parser/ParserErrorCode.java (right):

http://codereview.chromium.org/8564027/diff/4001/compiler/java/com/google/dar...
compiler/java/com/google/dart/compiler/parser/ParserErrorCode.java:13:
DEFAULT_PARAMETER_ABSTRACT("Default values can not be specified in abstract
method"),
On 2011/11/15 16:36:46, zundel wrote:
> On 2011/11/15 16:33:21, scheglov wrote:
> > On 2011/11/15 16:16:57, zundel wrote:
> > > DEFAULT_VALUE_NOT_IN_ABSTRACT_METHOD("Default value can ...
> > 
> > Hm... I don't understand why to use "NOT" here and in other places (except
of
> > operators and setter).
> > This is error, same as ABSTRACT_MEMBER_IN_INTERFACE, i.e. we   tell that
> > something is invalid - "default value for parameter in abstract method" is
> > invalid.
> 
> The convention in this file (with some exceptions) is that the enumeration
name
> matches at least the beginning default english translation of the message.  
> 
> To follow that convention to the letter, we should name it:
> DEFAULT_VALUE_CAN_NOT_BE_SPECIFIED_IN_ABSTRACT
> 
> That seems a little long to me, so I shortened it.

Done.

Powered by Google App Engine
This is Rietveld 408576698