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

Issue 2873313003: Make void-arrow-functions statically accept any expression type. (Closed)

Created:
3 years, 7 months ago by Lasse Reichstein Nielsen
Modified:
3 years, 7 months ago
Reviewers:
eernst
CC:
reviews_dartlang.org
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Make void-arrow-functions statically accept any expression type. R=eernst@google.com Committed: https://github.com/dart-lang/sdk/commit/26d6e3596d034024605ecf9dcfa489b544fa6245

Patch Set 1 #

Total comments: 13

Patch Set 2 : Address comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+18 lines, -6 lines) Patch
M docs/language/dartLangSpec.tex View 1 4 chunks +18 lines, -6 lines 0 comments Download

Messages

Total messages: 8 (2 generated)
Lasse Reichstein Nielsen
WDYT? Am I missing anything?
3 years, 7 months ago (2017-05-11 13:05:58 UTC) #2
Lasse Reichstein Nielsen
PTAL
3 years, 7 months ago (2017-05-18 14:57:40 UTC) #3
eernst
LGTM, with a couple of comments. https://codereview.chromium.org/2873313003/diff/1/docs/language/dartLangSpec.tex File docs/language/dartLangSpec.tex (right): https://codereview.chromium.org/2873313003/diff/1/docs/language/dartLangSpec.tex#newcode617 docs/language/dartLangSpec.tex:617: \item A block ...
3 years, 7 months ago (2017-05-19 09:48:14 UTC) #4
Lasse Reichstein Nielsen
https://codereview.chromium.org/2873313003/diff/1/docs/language/dartLangSpec.tex File docs/language/dartLangSpec.tex (right): https://codereview.chromium.org/2873313003/diff/1/docs/language/dartLangSpec.tex#newcode617 docs/language/dartLangSpec.tex:617: \item A block statement (\ref{blocks}) containing the statements (\ref{statements}) ...
3 years, 7 months ago (2017-05-22 14:18:50 UTC) #5
Lasse Reichstein Nielsen
Committed patchset #2 (id:20001) manually as 26d6e3596d034024605ecf9dcfa489b544fa6245 (presubmit successful).
3 years, 7 months ago (2017-05-22 14:20:28 UTC) #7
eernst
3 years, 7 months ago (2017-05-22 16:06:40 UTC) #8
Message was sent while issue was closed.
As a reminder for a new CL, there are still some typos: 
'{..}' --> '(..)' near flatten, and a few occurrences of 
`async` --> `\ASYNC{}`.

https://codereview.chromium.org/2873313003/diff/1/docs/language/dartLangSpec.tex
File docs/language/dartLangSpec.tex (right):

https://codereview.chromium.org/2873313003/diff/1/docs/language/dartLangSpec....
docs/language/dartLangSpec.tex:617: \item A block statement (\ref{blocks})
containing the statements  (\ref{statements}) executed by the function,
optionally marked with one of the modifiers: \ASYNC, \ASYNC* or \SYNC*.
On 2017/05/22 14:18:49, Lasse Reichstein Nielsen wrote:
> Indeed, I wrote that into the specification of method termination because then
> this line wouldn't be necessary.
> 
> I had a problem with this line: In a void function, it should give a warning
to
> have a `return null;` statement. It doesn't, arguably because the "added"
return
> statement is synthetic, but it's not really specified anywhere, and it's
easier
> if it just isn't there.

Acknowledged.

https://codereview.chromium.org/2873313003/diff/1/docs/language/dartLangSpec....
docs/language/dartLangSpec.tex:619: \commentary{
On 2017/05/22 14:18:49, Lasse Reichstein Nielsen wrote:
> My reason for changing this is that this is really the rationale for adding
> "return null;" - which the previous paragraph doesn't do any more. So, it's
> "rationalizing" something that we haven't said, which is just confusing. That
is
> We didn't say *that* every function must return a value, so why is there
> rationale saying *why*?
> 
> so I made it a comment. It is just reiterating rules from elsewhere to give
the
> reader a helpful reminder about how things work, which is comment-ish.

Acknowledged.

https://codereview.chromium.org/2873313003/diff/1/docs/language/dartLangSpec....
docs/language/dartLangSpec.tex:624: \item of the form \code{async => $e$} or the
form \code{\ASYNC{} => $e$}, which both return the value of the expression $e$
as if by a \code{return $e$}. \rationale{The other modifiers do not apply here,
because they apply only to generators, discussed below, and generators do not
allow returning a value, values are added to the generated stream or iterable
using \YIELD{} instead.}
On 2017/05/22 14:18:49, Lasse Reichstein Nielsen wrote:
> Yes on typo. Fixed.
> 
> Changed to commentary.
> 
> I'm not sure what the original distinction between commentary and rationale
was,
> but this rational is explaining a "why" (why only those two forms), which
might
> have been the reasoning.
> 
> Changed "not allowed returning" to "not allowed to return" because I can
> actually read that.

Acknowledged.

https://codereview.chromium.org/2873313003/diff/1/docs/language/dartLangSpec....
docs/language/dartLangSpec.tex:631: or the function is asynchronous and
\code{Future<flatten{$R$}>}
On 2017/05/22 14:18:49, Lasse Reichstein Nielsen wrote:
> Flatten fixed, both three places. The other ones could also be found by
> searching for "flatten(" :)
> 
> We should have a macro for flatten. I think I have one in another CL.
> 
> It's not a surprising coincidence - I made this change *because* I needed a
> place to write the special-case for void, so it couldn't use the original
> rewrite any more - since there was no way to distinguish an
arrow-void-function
> from a block-void-function at the return statement.

Oops, there's still one typo: '{..}' should be changed to '(..)'.

Powered by Google App Engine
This is Rietveld 408576698