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

Issue 2699073003: Support `void` as generic argument.

Created:
3 years, 10 months ago by floitsch
Modified:
3 years, 7 months ago
CC:
reviews_dartlang.org, ahe
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Support `void` as generic argument. Also allows `void` in other positions (like parameter positions). See https://docs.google.com/a/google.com/document/d/1HU7jRFqzRih4JpyHtiiVfitgtSKjN4Axi4HRAYurrSU for more context. Tests are (for now) in this CL: https://codereview.chromium.org/2707933002 BUG= TBD.

Patch Set 1 #

Patch Set 2 : Rebase #

Patch Set 3 : Keep void type. #

Patch Set 4 : Remove tests from this CL. #

Patch Set 5 : Add void warnings. #

Patch Set 6 : Rebase (still broken). #

Patch Set 7 : Rework after rebase. Void is now represented by "1". #

Patch Set 8 : Few cleanups. #

Patch Set 9 : Rebase #

Patch Set 10 : Add specialized messages for `void` for-ins. #

Total comments: 4

Patch Set 11 : Remove "howToFix" suggestions. #

Patch Set 12 : Rebase #

Total comments: 3

Patch Set 13 : Shuffle things around to have a better `voidRti` locality. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+809 lines, -153 lines) Patch
M pkg/compiler/lib/src/diagnostics/messages.dart View 1 2 3 4 5 6 7 8 9 10 11 4 chunks +27 lines, -0 lines 0 comments Download
M pkg/compiler/lib/src/elements/resolution_types.dart View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -1 line 0 comments Download
M pkg/compiler/lib/src/elements/types.dart View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +4 lines, -3 lines 0 comments Download
M pkg/compiler/lib/src/js_backend/namer.dart View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +0 lines, -4 lines 0 comments Download
M pkg/compiler/lib/src/js_backend/runtime_types.dart View 1 2 3 4 5 6 7 8 9 10 11 12 5 chunks +15 lines, -9 lines 0 comments Download
M pkg/compiler/lib/src/js_emitter/full_emitter/emitter.dart View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +3 lines, -0 lines 0 comments Download
M pkg/compiler/lib/src/js_emitter/startup_emitter/emitter.dart View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +3 lines, -0 lines 0 comments Download
M pkg/compiler/lib/src/resolution/resolution.dart View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +0 lines, -9 lines 0 comments Download
M pkg/compiler/lib/src/resolution/signatures.dart View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +1 line, -9 lines 0 comments Download
M pkg/compiler/lib/src/typechecker.dart View 1 2 3 4 5 6 7 8 9 10 11 33 chunks +65 lines, -46 lines 0 comments Download
M pkg/front_end/lib/src/fasta/parser/parser.dart View 1 2 3 4 5 6 7 8 9 10 11 14 chunks +9 lines, -37 lines 0 comments Download
M pkg/front_end/lib/src/scanner/token.dart View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -1 line 0 comments Download
M sdk/lib/_internal/js_runtime/lib/js_helper.dart View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +8 lines, -0 lines 0 comments Download
M sdk/lib/_internal/js_runtime/lib/js_mirrors.dart View 1 2 3 4 5 6 7 8 9 10 11 5 chunks +6 lines, -9 lines 0 comments Download
M sdk/lib/_internal/js_runtime/lib/js_rti.dart View 1 2 3 4 5 6 7 8 9 10 11 6 chunks +21 lines, -21 lines 0 comments Download
M sdk/lib/_internal/js_runtime/lib/shared/embedded_names.dart View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +5 lines, -4 lines 0 comments Download
A tests/language/void_type2_test.dart View 1 2 3 4 5 6 7 8 9 10 1 chunk +360 lines, -0 lines 0 comments Download
A tests/language/void_type3_test.dart View 1 2 3 4 5 6 7 8 9 10 1 chunk +121 lines, -0 lines 0 comments Download
A tests/language/void_type4_test.dart View 1 2 3 4 5 6 7 8 9 10 1 chunk +122 lines, -0 lines 0 comments Download
A tests/language/void_type5_test.dart View 1 2 3 4 5 6 7 8 9 10 1 chunk +37 lines, -0 lines 0 comments Download

Messages

Total messages: 11 (2 generated)
floitsch
First incomplete implementation. I would like to know if you are ok with this approach. ...
3 years, 10 months ago (2017-02-17 17:05:38 UTC) #2
floitsch
Changed it, to keep the void-type. Probably now need to adjust some inference, ...
3 years, 10 months ago (2017-02-22 19:44:57 UTC) #4
Siggi Cherem (dart-lang)
Overall changes lgtm. Adding ahe@ to make sure he takes a quick look at the ...
3 years, 9 months ago (2017-03-13 22:50:58 UTC) #5
floitsch
I added the tests. I will need to update the status files for the implementations ...
3 years, 9 months ago (2017-03-14 13:30:49 UTC) #6
floitsch
After rebase I don't have access to the rtiEncoder from the TypeRepresentationGenerator. Do you have ...
3 years, 7 months ago (2017-05-08 14:48:35 UTC) #7
Johnni Winther
https://codereview.chromium.org/2699073003/diff/220001/pkg/compiler/lib/src/js_backend/runtime_types.dart File pkg/compiler/lib/src/js_backend/runtime_types.dart (right): https://codereview.chromium.org/2699073003/diff/220001/pkg/compiler/lib/src/js_backend/runtime_types.dart#newcode1072 pkg/compiler/lib/src/js_backend/runtime_types.dart:1072: // TODO(floitsch): this should use the `voidRti` field from ...
3 years, 7 months ago (2017-05-09 07:50:40 UTC) #8
floitsch
Also made the type-representation generator private (as discussed in person). https://codereview.chromium.org/2699073003/diff/220001/pkg/compiler/lib/src/js_backend/runtime_types.dart File pkg/compiler/lib/src/js_backend/runtime_types.dart (right): https://codereview.chromium.org/2699073003/diff/220001/pkg/compiler/lib/src/js_backend/runtime_types.dart#newcode1072 ...
3 years, 7 months ago (2017-05-09 09:48:25 UTC) #9
Johnni Winther
lgtm
3 years, 7 months ago (2017-05-09 10:20:08 UTC) #10
floitsch
3 years, 7 months ago (2017-05-09 11:08:04 UTC) #11
Note: this currently breaks the warning for `Cannot return value from void
function.'

As in:

```
void foo() => 42;
```

Powered by Google App Engine
This is Rietveld 408576698