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

Issue 10115005: Static members are not visible in subclasses (Closed)

Created:
8 years, 8 months ago by hausner
Modified:
8 years, 8 months ago
Reviewers:
Bob Nystrom, sra1, siva
CC:
reviews_dartlang.org, ahe, vsm, Anton Muhin, Bob Nystrom, kasperl
Visibility:
Public.

Description

Static members are not visible in subclasses Fix for issue 1598. Lexical scope comes before inherited names. Also, Static members are not inherited and are not visible in subclasses. Code in the subclass (or any other code for that matter) has to qualify the names of these members with the class name. We had a few tests that were wrong and only passed in the VM because this was not implemented correctly. Also had to fix code in frog and dartdoc. I hope I ran enough tests. I built an all.deps tree using tools/build.py from the root directory, which brought up the frog and dartdoc issues. Tested: tools/test.py --compiler=dart2js --runtime=drt tools/test.py -c none -r drt tools/test.py -c frog -r drt tools/test.py -r vm Committed: https://code.google.com/p/dart/source/detail?r=6698

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : #

Total comments: 8

Patch Set 4 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+112 lines, -143 lines) Patch
M frog/tokenizer.dart View 1 2 3 6 chunks +7 lines, -7 lines 0 comments Download
M frog/tokenizer.g.dart View 1 2 3 3 chunks +4 lines, -4 lines 0 comments Download
M lib/dartdoc/block_parser.dart View 1 2 3 2 chunks +2 lines, -2 lines 0 comments Download
M runtime/bin/socket_impl.dart View 1 2 3 4 chunks +7 lines, -7 lines 0 comments Download
M runtime/vm/parser.cc View 1 2 3 1 chunk +65 lines, -66 lines 0 comments Download
M tests/co19/co19-runtime.status View 1 2 3 2 chunks +4 lines, -0 lines 0 comments Download
M tests/language/src/GettersSettersTest.dart View 1 2 3 5 chunks +2 lines, -22 lines 0 comments Download
M tests/language/src/PrivateMemberTest.dart View 1 2 3 2 chunks +2 lines, -2 lines 0 comments Download
M tests/language/src/StaticFieldTest.dart View 1 2 3 3 chunks +1 line, -9 lines 0 comments Download
M tests/language/src/SuperTest.dart View 1 2 3 2 chunks +18 lines, -24 lines 0 comments Download

Messages

Total messages: 7 (0 generated)
hausner
8 years, 8 months ago (2012-04-17 23:43:26 UTC) #1
Bob Nystrom
Dartdoc change LGTM.
8 years, 8 months ago (2012-04-18 00:03:51 UTC) #2
siva
LGTM http://codereview.chromium.org/10115005/diff/9/frog/tokenizer.dart File frog/tokenizer.dart (right): http://codereview.chromium.org/10115005/diff/9/frog/tokenizer.dart#newcode1 frog/tokenizer.dart:1: // Copyright (c) 2011, the Dart project authors. ...
8 years, 8 months ago (2012-04-18 00:56:23 UTC) #3
sra1
http://codereview.chromium.org/10115005/diff/9/frog/tokenizer.g.dart File frog/tokenizer.g.dart (right): http://codereview.chromium.org/10115005/diff/9/frog/tokenizer.g.dart#newcode7 frog/tokenizer.g.dart:7: /** A generated file that extends the hand coded ...
8 years, 8 months ago (2012-04-18 02:56:15 UTC) #4
sra1
http://codereview.chromium.org/10115005/diff/9/frog/tokenizer.dart File frog/tokenizer.dart (right): http://codereview.chromium.org/10115005/diff/9/frog/tokenizer.dart#newcode4 frog/tokenizer.dart:4: // Generated by scripts/tokenizer_gen.py. Please fix this file by ...
8 years, 8 months ago (2012-04-18 02:59:51 UTC) #5
ahe
Tests LGTM. As for frog, I don't mind if you update the generated file manually. ...
8 years, 8 months ago (2012-04-18 10:35:20 UTC) #6
hausner
8 years, 8 months ago (2012-04-18 16:49:26 UTC) #7
Thanks for the reviews

http://codereview.chromium.org/10115005/diff/9/frog/tokenizer.dart
File frog/tokenizer.dart (right):

http://codereview.chromium.org/10115005/diff/9/frog/tokenizer.dart#newcode1
frog/tokenizer.dart:1: // Copyright (c) 2011, the Dart project authors.  Please
see the AUTHORS file
On 2012/04/18 00:56:23, asiva wrote:
> 2012 (here and a few other files and tests cases).

Done.

http://codereview.chromium.org/10115005/diff/9/frog/tokenizer.dart#newcode4
frog/tokenizer.dart:4: // Generated by scripts/tokenizer_gen.py.
On 2012/04/18 02:59:52, sra1 wrote:
> Please fix this file by changing the generator and re-running it.
> 
> run ./scripts/tokenizer_gen.py from the frog directory

Since the generated file is checked in, I'll check in my hand-made changes and
file a bug to adapt the python file. I took a look at the generator and it's not
straight-forward to fix, at least for me.

http://codereview.chromium.org/10115005/diff/9/frog/tokenizer.g.dart
File frog/tokenizer.g.dart (right):

http://codereview.chromium.org/10115005/diff/9/frog/tokenizer.g.dart#newcode7
frog/tokenizer.g.dart:7: /** A generated file that extends the hand coded
methods in TokenizerBase. */
On 2012/04/18 02:56:15, sra1 wrote:
> This is a generated file.
> You need to change scripts/tokenizer_gen.py
> and manually re-run it.
See comment response in tokenizer.dart

http://codereview.chromium.org/10115005/diff/9/runtime/vm/parser.cc
File runtime/vm/parser.cc (right):

http://codereview.chromium.org/10115005/diff/9/runtime/vm/parser.cc#newcode6982
runtime/vm/parser.cc:6982: // Nothing found in scope of current class.
Yes. If necessary, I will do that as a separate change.

On 2012/04/18 00:56:23, asiva wrote:
> As discussed offline we need to figure if this will cause a performance
> regression in the benchmarks and startup times. If it does impact performance
> then it might make sense to add a ResolveInSuperClasses which only tries to
> resolve instance fields/functions in the superclass.

Powered by Google App Engine
This is Rietveld 408576698