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

Issue 11776037: Initial support for mixins in dartc. (Closed)

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

Description

Initial support for mixins in dartc. R=brianwilkerson@google.com BUG= Committed: https://code.google.com/p/dart/source/detail?r=16864

Patch Set 1 #

Total comments: 33

Patch Set 2 : Don't use supertype of interfaces of mixed in types #

Patch Set 3 : Forgot MixinScope.java #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+1325 lines, -180 lines) Patch
M compiler/java/com/google/dart/compiler/ast/ASTVisitor.java View 1 chunk +4 lines, -0 lines 0 comments Download
M compiler/java/com/google/dart/compiler/ast/DartClass.java View 5 chunks +10 lines, -21 lines 0 comments Download
A compiler/java/com/google/dart/compiler/ast/DartClassTypeAlias.java View 1 chunk +88 lines, -0 lines 0 comments Download
M compiler/java/com/google/dart/compiler/parser/CompletionHooksParserBase.java View 1 chunk +4 lines, -0 lines 0 comments Download
M compiler/java/com/google/dart/compiler/parser/DartParser.java View 5 chunks +153 lines, -21 lines 0 comments Download
M compiler/java/com/google/dart/compiler/parser/ParserErrorCode.java View 3 chunks +8 lines, -1 line 0 comments Download
M compiler/java/com/google/dart/compiler/parser/Token.java View 1 chunk +1 line, -0 lines 0 comments Download
A compiler/java/com/google/dart/compiler/resolver/ClassAliasElement.java View 1 1 chunk +11 lines, -0 lines 0 comments Download
M compiler/java/com/google/dart/compiler/resolver/ClassElement.java View 1 chunk +2 lines, -0 lines 0 comments Download
M compiler/java/com/google/dart/compiler/resolver/ClassElementImplementation.java View 1 7 chunks +47 lines, -0 lines 0 comments Download
M compiler/java/com/google/dart/compiler/resolver/ClassElementUnion.java View 1 chunk +5 lines, -0 lines 0 comments Download
M compiler/java/com/google/dart/compiler/resolver/ClassScope.java View 1 1 chunk +19 lines, -6 lines 1 comment Download
M compiler/java/com/google/dart/compiler/resolver/DynamicElementImplementation.java View 1 chunk +5 lines, -0 lines 0 comments Download
M compiler/java/com/google/dart/compiler/resolver/Elements.java View 1 8 chunks +70 lines, -21 lines 1 comment Download
A compiler/java/com/google/dart/compiler/resolver/MixinScope.java View 1 2 1 chunk +27 lines, -0 lines 0 comments Download
M compiler/java/com/google/dart/compiler/resolver/ResolutionContext.java View 2 chunks +5 lines, -0 lines 0 comments Download
M compiler/java/com/google/dart/compiler/resolver/Resolver.java View 2 chunks +16 lines, -0 lines 0 comments Download
M compiler/java/com/google/dart/compiler/resolver/ResolverErrorCode.java View 1 3 chunks +3 lines, -0 lines 0 comments Download
M compiler/java/com/google/dart/compiler/resolver/SupertypeResolver.java View 1 5 chunks +67 lines, -8 lines 0 comments Download
M compiler/java/com/google/dart/compiler/resolver/TopLevelElementBuilder.java View 2 chunks +14 lines, -0 lines 0 comments Download
M compiler/java/com/google/dart/compiler/type/InterfaceTypeImplementation.java View 1 2 chunks +31 lines, -8 lines 1 comment Download
M compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java View 1 2 chunks +27 lines, -5 lines 0 comments Download
M compiler/java/com/google/dart/compiler/type/Types.java View 1 2 chunks +12 lines, -2 lines 0 comments Download
M compiler/javatests/com/google/dart/compiler/parser/SyntaxTest.java View 1 chunk +69 lines, -0 lines 0 comments Download
M compiler/javatests/com/google/dart/compiler/resolver/ResolverTestCase.java View 1 chunk +7 lines, -5 lines 0 comments Download
M compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java View 1 2 chunks +144 lines, -0 lines 0 comments Download
M editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/ast/ClassTypeAlias.java View 1 chunk +1 line, -1 line 0 comments Download
M editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/dom/AST.java View 1 chunk +1 line, -0 lines 0 comments Download
M editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/internal/completion/ast/ClassCompleter.java View 3 chunks +6 lines, -3 lines 0 comments Download
M editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/internal/index/contributor/IndexContributor.java View 1 chunk +3 lines, -0 lines 0 comments Download
M editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/internal/model/CompilationUnitImpl.java View 4 chunks +39 lines, -0 lines 0 comments Download
A editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/internal/model/DartClassTypeAliasImpl.java View 1 chunk +140 lines, -0 lines 0 comments Download
M editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/internal/model/DartElementImpl.java View 3 chunks +7 lines, -1 line 0 comments Download
M editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/internal/util/MementoTokenizer.java View 2 chunks +3 lines, -0 lines 0 comments Download
M editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/model/CompilationUnit.java View 2 chunks +10 lines, -0 lines 0 comments Download
A editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/model/DartClassTypeAlias.java View 1 chunk +64 lines, -0 lines 0 comments Download
M editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/model/DartElement.java View 1 chunk +6 lines, -0 lines 0 comments Download
M editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/utilities/bindings/BindingUtils.java View 1 10 chunks +157 lines, -63 lines 1 comment Download
M editor/tools/plugins/com.google.dart.tools.core_test/src/com/google/dart/tools/core/utilities/ast/DartElementLocatorTest.java View 2 chunks +14 lines, -0 lines 0 comments Download
M editor/tools/plugins/com.google.dart.tools.core_test/src/com/google/dart/tools/core/utilities/bindings/BindingUtilsTest.java View 1 1 chunk +11 lines, -11 lines 0 comments Download
M editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/text/dart/DartCodeScanner.java View 2 chunks +2 lines, -2 lines 0 comments Download
M editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/text/editor/SemanticHighlightingReconciler.java View 2 chunks +7 lines, -0 lines 0 comments Download
M editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/text/editor/SemanticHighlightings.java View 2 chunks +2 lines, -1 line 0 comments Download
M tests/language/language.status View 1 1 chunk +3 lines, -0 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
scheglov
7 years, 11 months ago (2013-01-08 08:23:13 UTC) #1
Brian Wilkerson
Unfortunately, I think there is one underlying problem that causes several places in the code ...
7 years, 11 months ago (2013-01-08 16:40:06 UTC) #2
scheglov
PTAL https://codereview.chromium.org/11776037/diff/1/compiler/java/com/google/dart/compiler/resolver/ClassAliasElement.java File compiler/java/com/google/dart/compiler/resolver/ClassAliasElement.java (right): https://codereview.chromium.org/11776037/diff/1/compiler/java/com/google/dart/compiler/resolver/ClassAliasElement.java#newcode1 compiler/java/com/google/dart/compiler/resolver/ClassAliasElement.java:1: // Copyright (c) 2012, the Dart project authors. ...
7 years, 11 months ago (2013-01-09 00:59:39 UTC) #3
Brian Wilkerson
7 years, 11 months ago (2013-01-09 16:17:41 UTC) #4
LGTM once comments have been addressed

https://codereview.chromium.org/11776037/diff/13001/compiler/java/com/google/...
File compiler/java/com/google/dart/compiler/resolver/ClassScope.java (right):

https://codereview.chromium.org/11776037/diff/13001/compiler/java/com/google/...
compiler/java/com/google/dart/compiler/resolver/ClassScope.java:65: MixinScope
scope = new MixinScope(intfElement,
I think this wanted to still be ClassScope and you wanted to change it to
MixinScope on line 79.

https://codereview.chromium.org/11776037/diff/13001/compiler/java/com/google/...
File compiler/java/com/google/dart/compiler/resolver/Elements.java (right):

https://codereview.chromium.org/11776037/diff/13001/compiler/java/com/google/...
compiler/java/com/google/dart/compiler/resolver/Elements.java:380: result =
lookupFieldElementSetter(mixinType.getElement(), name);
I believe that this needs to invoke lookupFieldElementSetter0.

https://codereview.chromium.org/11776037/diff/13001/compiler/java/com/google/...
File
compiler/java/com/google/dart/compiler/type/InterfaceTypeImplementation.java
(right):

https://codereview.chromium.org/11776037/diff/13001/compiler/java/com/google/...
compiler/java/com/google/dart/compiler/type/InterfaceTypeImplementation.java:126:
for (InterfaceType intrface : getMixins()) {
nit: "intrface" --> "mixin"

https://codereview.chromium.org/11776037/diff/13001/editor/tools/plugins/com....
File
editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/utilities/bindings/BindingUtils.java
(right):

https://codereview.chromium.org/11776037/diff/13001/editor/tools/plugins/com....
editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/utilities/bindings/BindingUtils.java:1417:
//    supertypes.addAll(targetType.getMixins());
Please add a comment that adding the mixins might be wrong so that if someone
decides to uncomment this method they'll know that it might not be doing the
right thing.

Powered by Google App Engine
This is Rietveld 408576698