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

Issue 427603002: Properly handle "#void" in analysis server. (Closed)

Created:
6 years, 4 months ago by Paul Berry
Modified:
3 years, 8 months ago
Reviewers:
Brian Wilkerson
CC:
reviews_dartlang.org, ricow1
Visibility:
Public.

Description

Properly handle "#void" in analysis server. Also fix corelib/symbol_reserved_word_test/05, which was incorrectly marked as a compile-time error. It should be a static type warning, since "#void.foo" should be interpreted as "access the 'foo' field of the 'void' symbol". BUG=dartbug.com/20191 R=brianwilkerson@google.com Committed: https://code.google.com/p/dart/source/detail?r=38641

Patch Set 1 #

Total comments: 4

Messages

Total messages: 7 (0 generated)
Paul Berry
6 years, 4 months ago (2014-07-28 16:49:39 UTC) #1
Brian Wilkerson
LGTM
6 years, 4 months ago (2014-07-28 18:09:10 UTC) #2
Paul Berry
Committed patchset #1 manually as r38641 (presubmit successful).
6 years, 4 months ago (2014-07-28 19:03:11 UTC) #3
ahe
https://codereview.chromium.org/427603002/diff/1/tests/corelib/symbol_reserved_word_test.dart File tests/corelib/symbol_reserved_word_test.dart (right): https://codereview.chromium.org/427603002/diff/1/tests/corelib/symbol_reserved_word_test.dart#newcode21 tests/corelib/symbol_reserved_word_test.dart:21: x = #void.foo; /// 05: static type warning What ...
3 years, 8 months ago (2017-04-05 20:04:14 UTC) #4
Paul Berry
https://codereview.chromium.org/427603002/diff/1/tests/corelib/symbol_reserved_word_test.dart File tests/corelib/symbol_reserved_word_test.dart (right): https://codereview.chromium.org/427603002/diff/1/tests/corelib/symbol_reserved_word_test.dart#newcode21 tests/corelib/symbol_reserved_word_test.dart:21: x = #void.foo; /// 05: static type warning On ...
3 years, 8 months ago (2017-04-05 20:29:29 UTC) #5
ahe
https://codereview.chromium.org/427603002/diff/1/tests/corelib/symbol_reserved_word_test.dart File tests/corelib/symbol_reserved_word_test.dart (right): https://codereview.chromium.org/427603002/diff/1/tests/corelib/symbol_reserved_word_test.dart#newcode21 tests/corelib/symbol_reserved_word_test.dart:21: x = #void.foo; /// 05: static type warning On ...
3 years, 8 months ago (2017-04-06 10:55:52 UTC) #6
Paul Berry
3 years, 8 months ago (2017-04-06 17:20:58 UTC) #7
Message was sent while issue was closed.
https://codereview.chromium.org/427603002/diff/1/tests/corelib/symbol_reserve...
File tests/corelib/symbol_reserved_word_test.dart (right):

https://codereview.chromium.org/427603002/diff/1/tests/corelib/symbol_reserve...
tests/corelib/symbol_reserved_word_test.dart:21: x = #void.foo;               
/// 05: static type warning
On 2017/04/06 10:55:52, ahe wrote:
> On 2017/04/05 20:29:28, Paul Berry wrote:
> > On 2017/04/05 20:04:14, ahe wrote:
> > > What is supposed to happen when this line is executed?
> > 
> > It should be equivalent to:
> > 
> > x = (#void).foo;
> > 
> > So it should produce a runtime error:
> > 
> > NoSuchMethodError: Class 'Symbol' has no instance getter 'foo'.
> > 
> > Gilad was supposed to update the spec so that the grammar rule for symbol
> would
> > be:
> > 
> > symbolLiteral:
> >   ‘#’ (void | operator | (identifier (‘.’ identifier)*))
> >   ;
> > 
> > But it looks like he never got around to it
> > (https://github.com/dart-lang/sdk/issues/20191 is still open).
> > 
> > In retrospect I used the wrong test expectation; it should have been:
> > 
> > x = #void.foo; /// 05: runtime error, static type warning
> > 
> > Or maybe this would have been clearer:
> > 
> > x = #void.hashCode; /// 05: ok
> 
> Thank you for the details. Based on them, I've changed it to:
> 
> Expect.throws(() { x = #void.foo; }, (e) => e is NoSuchMethodError); //# 05:
> static type warning
> 
> In CL 2804843003.

Sounds reasonable.  Thanks!

Powered by Google App Engine
This is Rietveld 408576698