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

Issue 707073002: Fix analyzer's treatment of mixin constructors. (Closed)

Created:
6 years, 1 month ago by Paul Berry
Modified:
6 years, 1 month ago
Reviewers:
Brian Wilkerson
CC:
reviews_dartlang.org, gbracha, regis, hausner, Johnni Winther
Visibility:
Public.

Description

Fix analyzer's treatment of mixin constructors. This changes analyzer to match the spec (and the VM behavior) with regard to which base class constructors are forwarded through mixin applications: only those constructors that take zero optional parameters are forwarded. In addition, the tests in tests/language/ are updated to match analyzer and the VM. There is one small difference between analyzer and the VM behavior: the spec says that if no constructors are forwarded at all, then the mixin application will automatically acquire an implicit default constructor. The VM behavior is to issue an error in this circumstance. After consulting with Gilad, it seems like the VM behavior is more consistent with the intent, so I've chosen to make analyzer and the tests match the VM behavior, in the hopes that the spec can be changed accordingly. Should we change our minds in the future and decide that we want to keep the spec as is, the tests and analyzer behavior can easily be changed. BUG=dartbug.com/19576 R=brianwilkerson@google.com Committed: https://code.google.com/p/dart/source/detail?r=41645

Patch Set 1 #

Patch Set 2 : Minor clean-ups #

Total comments: 4

Patch Set 3 : Improve error message. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+522 lines, -34 lines) Patch
M pkg/analyzer/lib/src/generated/element.dart View 2 chunks +23 lines, -0 lines 0 comments Download
M pkg/analyzer/lib/src/generated/element_handle.dart View 1 chunk +4 lines, -0 lines 0 comments Download
M pkg/analyzer/lib/src/generated/element_resolver.dart View 1 chunk +2 lines, -1 line 0 comments Download
M pkg/analyzer/lib/src/generated/error.dart View 1 2 1 chunk +12 lines, -0 lines 0 comments Download
M pkg/analyzer/lib/src/generated/error_verifier.dart View 2 chunks +6 lines, -2 lines 0 comments Download
M pkg/analyzer/lib/src/generated/resolver.dart View 1 2 1 chunk +6 lines, -1 line 0 comments Download
M pkg/analyzer/test/generated/all_the_rest.dart View 1 chunk +77 lines, -0 lines 0 comments Download
M pkg/analyzer/test/generated/compile_time_error_code_test.dart View 5 chunks +228 lines, -3 lines 0 comments Download
M pkg/analyzer/test/generated/resolver_test.dart View 1 chunk +103 lines, -0 lines 0 comments Download
M tests/language/language.status View 2 chunks +0 lines, -3 lines 0 comments Download
M tests/language/language_analyzer.status View 1 chunk +5 lines, -0 lines 0 comments Download
M tests/language/language_dart2js.status View 1 2 chunks +5 lines, -4 lines 0 comments Download
M tests/language/mixin_forwarding_constructor2_test.dart View 1 chunk +1 line, -1 line 0 comments Download
A + tests/language/mixin_forwarding_constructor3_test.dart View 2 chunks +8 lines, -3 lines 0 comments Download
A tests/language/mixin_forwarding_constructor4_test.dart View 1 chunk +26 lines, -0 lines 0 comments Download
M tests/language/mixin_super_constructor_named_test.dart View 2 chunks +9 lines, -8 lines 0 comments Download
M tests/language/mixin_super_constructor_positionals_test.dart View 3 chunks +7 lines, -8 lines 0 comments Download

Messages

Total messages: 6 (1 generated)
Paul Berry
Note: this will fix bug 19576 and render bug 13641 obsolete. See also bug 15101.
6 years, 1 month ago (2014-11-07 01:02:53 UTC) #2
Brian Wilkerson
https://codereview.chromium.org/707073002/diff/20001/pkg/analyzer/lib/src/generated/error.dart File pkg/analyzer/lib/src/generated/error.dart (right): https://codereview.chromium.org/707073002/diff/20001/pkg/analyzer/lib/src/generated/error.dart#newcode1435 pkg/analyzer/lib/src/generated/error.dart:1435: "parameter."); I find this message to be confusing and ...
6 years, 1 month ago (2014-11-07 16:59:32 UTC) #3
Brian Wilkerson
LGTM
6 years, 1 month ago (2014-11-07 17:10:12 UTC) #4
Paul Berry
https://codereview.chromium.org/707073002/diff/20001/pkg/analyzer/lib/src/generated/error.dart File pkg/analyzer/lib/src/generated/error.dart (right): https://codereview.chromium.org/707073002/diff/20001/pkg/analyzer/lib/src/generated/error.dart#newcode1435 pkg/analyzer/lib/src/generated/error.dart:1435: "parameter."); On 2014/11/07 16:59:32, Brian Wilkerson wrote: > I ...
6 years, 1 month ago (2014-11-07 17:31:01 UTC) #5
Paul Berry
6 years, 1 month ago (2014-11-10 19:28:54 UTC) #6
Message was sent while issue was closed.
Committed patchset #3 (id:40001) manually as 41645 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698