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

Issue 11886097: Get the most basic mixin applications working. (Closed)

Created:
7 years, 11 months ago by kasperl
Modified:
7 years, 11 months ago
Reviewers:
ahe, gbracha
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Get the most basic mixin applications working. This CL builds upon the code in https://codereview.chromium.org/11970011/ so that needs to land before this can. R=ahe@google.com BUG= Committed: https://code.google.com/p/dart/source/detail?r=17268

Patch Set 1 #

Patch Set 2 : Extend test case. #

Patch Set 3 : Diff against right branch. #

Total comments: 2

Patch Set 4 : Implement mixed in interface. #

Patch Set 5 : Add simple field test. #

Patch Set 6 : Split method test. #

Patch Set 7 : Add naming test. #

Patch Set 8 : Add test for subclassing mixin applications. #

Patch Set 9 : Fix checked mode. #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+428 lines, -75 lines) Patch
M sdk/lib/_internal/compiler/implementation/elements/elements.dart View 2 2 chunks +7 lines, -0 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/elements/modelx.dart View 2 8 chunks +40 lines, -21 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/resolution/members.dart View 1 2 3 4 5 6 7 8 11 chunks +99 lines, -52 lines 3 comments Download
M sdk/lib/_internal/compiler/implementation/resolution/resolution.dart View 1 chunk +2 lines, -2 lines 0 comments Download
A tests/language/mixin_field_test.dart View 1 2 3 4 5 6 7 1 chunk +118 lines, -0 lines 1 comment Download
A tests/language/mixin_is_test.dart View 1 2 3 4 5 6 7 1 chunk +77 lines, -0 lines 0 comments Download
A tests/language/mixin_method_test.dart View 1 2 3 4 5 6 7 1 chunk +52 lines, -0 lines 0 comments Download
A tests/language/mixin_naming_test.dart View 1 2 3 4 5 6 1 chunk +33 lines, -0 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
kasperl
Gilad: Please take a look at the test case. The rest is still very much ...
7 years, 11 months ago (2013-01-17 14:10:26 UTC) #1
gbracha
See comments re subtyping https://codereview.chromium.org/11886097/diff/14/tests/language/mixin_test.dart File tests/language/mixin_test.dart (right): https://codereview.chromium.org/11886097/diff/14/tests/language/mixin_test.dart#newcode33 tests/language/mixin_test.dart:33: Expect.isFalse(c is M2); So per ...
7 years, 11 months ago (2013-01-17 18:24:20 UTC) #2
kasperl
https://codereview.chromium.org/11886097/diff/14/tests/language/mixin_test.dart File tests/language/mixin_test.dart (right): https://codereview.chromium.org/11886097/diff/14/tests/language/mixin_test.dart#newcode33 tests/language/mixin_test.dart:33: Expect.isFalse(c is M2); On 2013/01/17 18:24:20, gbracha wrote: > ...
7 years, 11 months ago (2013-01-18 06:21:10 UTC) #3
ahe
7 years, 11 months ago (2013-01-18 12:40:12 UTC) #4
LGTM!

You should probably add a test of having a cyclic mixin hierarchy.

https://codereview.chromium.org/11886097/diff/18001/sdk/lib/_internal/compile...
File sdk/lib/_internal/compiler/implementation/resolution/members.dart (right):

https://codereview.chromium.org/11886097/diff/18001/sdk/lib/_internal/compile...
sdk/lib/_internal/compiler/implementation/resolution/members.dart:2826: new
SourceString("${superName}_${mixinName}"),
I'm really concerned about this. We did something similar for constructors and
operators, and it has been a nightmare to get rid of it, and deal with the weird
situations that occur when a user defines a name that conflicts with the
generated name.

It would be much better if you could generate a synthetic name that isn't a
valid Dart identifier. In fact, if you always used the empty string, it would be
clear that you cannot use this identifier for looking it up elsewhere in the
system.

https://codereview.chromium.org/11886097/diff/18001/sdk/lib/_internal/compile...
sdk/lib/_internal/compiler/implementation/resolution/members.dart:3013:
visitNodeList(node.interfaces);
Generally, I don't like calling the visitor methods directly. I removes dynamic
dispatch.

https://codereview.chromium.org/11886097/diff/18001/sdk/lib/_internal/compile...
sdk/lib/_internal/compiler/implementation/resolution/members.dart:3018:
visitNodeList(node.mixins);
Ditto.

https://codereview.chromium.org/11886097/diff/18001/tests/language/mixin_fiel...
File tests/language/mixin_field_test.dart (right):

https://codereview.chromium.org/11886097/diff/18001/tests/language/mixin_fiel...
tests/language/mixin_field_test.dart:41: Expect.throws(() => c.baz, (error) =>
error is NoSuchMethodError);
You could create a help function for: (error) => error is NoSuchMethodError

Powered by Google App Engine
This is Rietveld 408576698