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

Issue 12082045: Add optional and named parameters to FunctionType. (Closed)

Created:
7 years, 10 months ago by Johnni Winther
Modified:
7 years, 10 months ago
Reviewers:
karlklose
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Add optional and named parameters to FunctionType. Intentionally omit equals/hashCode implementation for a later CL which updates Types.isSubtype. Committed: https://code.google.com/p/dart/source/detail?r=17760

Patch Set 1 #

Total comments: 10

Patch Set 2 : Updated cf. comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+140 lines, -36 lines) Patch
M sdk/lib/_internal/compiler/implementation/dart_backend/backend.dart View 1 1 chunk +7 lines, -2 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/elements/modelx.dart View 1 chunk +4 lines, -2 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/resolution/members.dart View 1 1 chunk +29 lines, -10 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/typechecker.dart View 1 5 chunks +94 lines, -20 lines 0 comments Download
M tests/compiler/dart2js/type_checker_test.dart View 1 chunk +6 lines, -2 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
Johnni Winther
7 years, 10 months ago (2013-01-29 11:51:54 UTC) #1
karlklose
https://codereview.chromium.org/12082045/diff/1/sdk/lib/_internal/compiler/implementation/dart_backend/backend.dart File sdk/lib/_internal/compiler/implementation/dart_backend/backend.dart (right): https://codereview.chromium.org/12082045/diff/1/sdk/lib/_internal/compiler/implementation/dart_backend/backend.dart#newcode391 sdk/lib/_internal/compiler/implementation/dart_backend/backend.dart:391: compiler.types.voidType, const Link<DartType>(), Could you either put each argument ...
7 years, 10 months ago (2013-01-29 13:13:29 UTC) #2
karlklose
LGTM after you remove the unused method and fix the comment.
7 years, 10 months ago (2013-01-29 13:15:12 UTC) #3
Johnni Winther
7 years, 10 months ago (2013-01-29 13:53:58 UTC) #4
https://codereview.chromium.org/12082045/diff/1/sdk/lib/_internal/compiler/im...
File sdk/lib/_internal/compiler/implementation/dart_backend/backend.dart
(right):

https://codereview.chromium.org/12082045/diff/1/sdk/lib/_internal/compiler/im...
sdk/lib/_internal/compiler/implementation/dart_backend/backend.dart:391:
compiler.types.voidType, const Link<DartType>(),
On 2013/01/29 13:13:29, karlklose wrote:
> Could you either put each argument on its own line or fill the lines?

Done.

https://codereview.chromium.org/12082045/diff/1/sdk/lib/_internal/compiler/im...
File sdk/lib/_internal/compiler/implementation/resolution/members.dart (right):

https://codereview.chromium.org/12082045/diff/1/sdk/lib/_internal/compiler/im...
sdk/lib/_internal/compiler/implementation/resolution/members.dart:868: return
new FunctionType(element,
On 2013/01/29 13:13:29, karlklose wrote:
> You can share this code with l. 897 by storing the optinal and named
parameters
> into local link builders.

Done.

https://codereview.chromium.org/12082045/diff/1/sdk/lib/_internal/compiler/im...
File sdk/lib/_internal/compiler/implementation/typechecker.dart (right):

https://codereview.chromium.org/12082045/diff/1/sdk/lib/_internal/compiler/im...
sdk/lib/_internal/compiler/implementation/typechecker.dart:429: this.isMalformed
= returnType != null &&
On 2013/01/29 13:13:29, karlklose wrote:
> It is annoying that we cannot use field initializers for this list. Could we
> make isMalformed a getter, or would that be too expensive?

Done.

https://codereview.chromium.org/12082045/diff/1/sdk/lib/_internal/compiler/im...
sdk/lib/_internal/compiler/implementation/typechecker.dart:439: DartType
getNamedParameterType(String name) {
Method removed.

Powered by Google App Engine
This is Rietveld 408576698