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

Issue 8786002: Check that interface constructors and default class constructors are compatible. (Closed)

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

Description

Check that interface constructors and default class constructors are compatible. 1. Number of required parameters. 2. Names and order of named parameters. 3. [disabled] type warning for non-identical types. 4. [wait for Eric, not implemented] type parameters check. R=zundel@google.com BUG= TEST= Committed: https://code.google.com/p/dart/source/detail?r=2124

Patch Set 1 #

Total comments: 11

Patch Set 2 : Check that types of constructors parameters are identical #

Total comments: 9
Unified diffs Side-by-side diffs Delta from patch set Stats (+571 lines, -167 lines) Patch
M client/html/src/MessageEvent.dart View 1 chunk +1 line, -1 line 0 comments Download
M client/html/src/TouchEventWrappingImplementation.dart View 1 chunk +1 line, -1 line 0 comments Download
M client/samples/total/src/DateTimeUtils.dart View 1 1 chunk +1 line, -1 line 0 comments Download
M client/touch/Momentum.dart View 1 1 chunk +1 line, -1 line 0 comments Download
M compiler/java/com/google/dart/compiler/SystemLibraryManager.java View 1 1 chunk +7 lines, -7 lines 2 comments Download
M compiler/java/com/google/dart/compiler/backend/js/Normalizer.java View 1 1 chunk +10 lines, -0 lines 0 comments Download
M compiler/java/com/google/dart/compiler/resolver/ConstructorElement.java View 1 1 chunk +12 lines, -4 lines 0 comments Download
M compiler/java/com/google/dart/compiler/resolver/ConstructorElementImplementation.java View 1 2 chunks +11 lines, -0 lines 0 comments Download
M compiler/java/com/google/dart/compiler/resolver/DynamicElementImplementation.java View 1 1 chunk +10 lines, -0 lines 0 comments Download
M compiler/java/com/google/dart/compiler/resolver/Elements.java View 1 2 chunks +42 lines, -0 lines 0 comments Download
M compiler/java/com/google/dart/compiler/resolver/Resolver.java View 1 3 chunks +143 lines, -76 lines 0 comments Download
M compiler/java/com/google/dart/compiler/resolver/ResolverErrorCode.java View 1 2 chunks +5 lines, -2 lines 0 comments Download
M compiler/java/com/google/dart/compiler/resolver/SyntheticDefaultConstructorElement.java View 1 3 chunks +11 lines, -1 line 0 comments Download
M compiler/java/com/google/dart/compiler/resolver/TypeErrorCode.java View 1 1 chunk +2 lines, -0 lines 0 comments Download
M compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java View 1 2 chunks +40 lines, -0 lines 0 comments Download
M compiler/javatests/com/google/dart/compiler/CompilerTestCase.java View 1 3 chunks +26 lines, -0 lines 2 comments Download
M compiler/javatests/com/google/dart/compiler/SystemLibraryManagerTest.java View 1 2 chunks +13 lines, -20 lines 2 comments Download
M compiler/javatests/com/google/dart/compiler/resolver/ResolverCompilerTest.java View 1 5 chunks +143 lines, -23 lines 0 comments Download
M compiler/javatests/com/google/dart/compiler/resolver/ResolverTest.java View 1 chunk +0 lines, -13 lines 0 comments Download
M compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java View 1 3 chunks +81 lines, -0 lines 0 comments Download
M compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerTest.java View 1 1 chunk +0 lines, -13 lines 3 comments Download
M compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerTestCase.java View 1 1 chunk +7 lines, -0 lines 0 comments Download
M compiler/lib/implementation/date_implementation.dart View 1 2 chunks +2 lines, -2 lines 0 comments Download
M corelib/src/implementation/promise_implementation.dart View 1 1 chunk +1 line, -1 line 0 comments Download
M corelib/src/time_zone.dart View 1 1 chunk +1 line, -0 lines 0 comments Download
M tests/language/language.status View 1 1 chunk +0 lines, -1 line 0 comments Download

Messages

Total messages: 6 (0 generated)
scheglov
9 years ago (2011-12-02 21:49:24 UTC) #1
zundel
I guess the other implementations aren't enforcing all these checks yet based on your changes ...
9 years ago (2011-12-05 14:52:17 UTC) #2
zundel
http://codereview.chromium.org/8786002/diff/1/compiler/java/com/google/dart/compiler/resolver/Elements.java File compiler/java/com/google/dart/compiler/resolver/Elements.java (right): http://codereview.chromium.org/8786002/diff/1/compiler/java/com/google/dart/compiler/resolver/Elements.java#newcode307 compiler/java/com/google/dart/compiler/resolver/Elements.java:307: public static List<String> getParametersTypes(MethodElement method) { On 2011/12/05 14:52:17, ...
9 years ago (2011-12-05 15:46:15 UTC) #3
scheglov
I'v implemented check for type names. I have to tweak couple places in library and ...
9 years ago (2011-12-05 19:28:01 UTC) #4
zundel
lgtm http://codereview.chromium.org/8786002/diff/8001/compiler/java/com/google/dart/compiler/SystemLibraryManager.java File compiler/java/com/google/dart/compiler/SystemLibraryManager.java (right): http://codereview.chromium.org/8786002/diff/8001/compiler/java/com/google/dart/compiler/SystemLibraryManager.java#newcode116 compiler/java/com/google/dart/compiler/SystemLibraryManager.java:116: * @param uri spurious n/l http://codereview.chromium.org/8786002/diff/8001/compiler/javatests/com/google/dart/compiler/CompilerTestCase.java File compiler/javatests/com/google/dart/compiler/CompilerTestCase.java ...
9 years ago (2011-12-05 21:26:45 UTC) #5
scheglov
9 years ago (2011-12-06 14:20:39 UTC) #6
http://codereview.chromium.org/8786002/diff/8001/compiler/java/com/google/dar...
File compiler/java/com/google/dart/compiler/SystemLibraryManager.java (right):

http://codereview.chromium.org/8786002/diff/8001/compiler/java/com/google/dar...
compiler/java/com/google/dart/compiler/SystemLibraryManager.java:116: * @param
uri
On 2011/12/05 21:26:45, zundel wrote:
> spurious n/l

Done.

http://codereview.chromium.org/8786002/diff/8001/compiler/javatests/com/googl...
File compiler/javatests/com/google/dart/compiler/CompilerTestCase.java (right):

http://codereview.chromium.org/8786002/diff/8001/compiler/javatests/com/googl...
compiler/javatests/com/google/dart/compiler/CompilerTestCase.java:361:
rootNode.accept(new DartNodeTraverser<Void>() {
On 2011/12/05 21:26:45, zundel wrote:
> To simplify, you can make DartNodeTraverser<DartNewExpression>
> and then just return it directly
> 
> return rootNode.accept(new DartNodeTraverser<DartNewExpression>...
> 
> See MemberBuilder.buildConstructor()

Does not work because of limitations of DartNodeTraverser.

http://codereview.chromium.org/8786002/diff/8001/compiler/javatests/com/googl...
File compiler/javatests/com/google/dart/compiler/SystemLibraryManagerTest.java
(right):

http://codereview.chromium.org/8786002/diff/8001/compiler/javatests/com/googl...
compiler/javatests/com/google/dart/compiler/SystemLibraryManagerTest.java:20: }
On 2011/12/05 21:26:45, zundel wrote:
> are these your changes or did they creep in from a sync?

These are my changes.
I found that there are many broken tests and tried to fix simple ones.

http://codereview.chromium.org/8786002/diff/8001/compiler/javatests/com/googl...
File compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerTest.java
(left):

http://codereview.chromium.org/8786002/diff/8001/compiler/javatests/com/googl...
compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerTest.java:335:
analyzeFail("Baz x = new Foo('');",
TypeErrorCode.TYPE_NOT_ASSIGNMENT_COMPATIBLE);
On 2011/12/05 21:26:45, zundel wrote:
> why did you remove this test?  this statement should fail.

Done.

Powered by Google App Engine
This is Rietveld 408576698