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

Issue 23583035: Emit a compile-time error when returning a value from a constructor. (Closed)

Created:
7 years, 3 months ago by karlklose
Modified:
7 years, 3 months ago
Reviewers:
ngeoffray
CC:
reviews_dartlang.org, Søren Gjesse
Visibility:
Public.

Description

Emit a compile-time error when returning a value from a constructor. BUG=dartbug.com/12937, dartbug.com/12938 R=ngeoffray@google.com Committed: https://code.google.com/p/dart/source/detail?r=27129

Patch Set 1 #

Patch Set 2 : Add a reference to spec. #

Patch Set 3 : Remove type-checker warning. #

Patch Set 4 : Include howToFix and example in error message. #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+25 lines, -17 lines) Patch
M sdk/lib/_internal/compiler/implementation/resolution/members.dart View 1 2 1 chunk +9 lines, -0 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/typechecker.dart View 1 2 1 chunk +4 lines, -1 line 0 comments Download
M sdk/lib/_internal/compiler/implementation/warnings.dart View 1 2 3 1 chunk +12 lines, -0 lines 1 comment Download
M tests/co19/co19-dart2dart.status View 1 chunk +0 lines, -3 lines 0 comments Download
M tests/co19/co19-dart2js.status View 1 chunk +0 lines, -3 lines 0 comments Download
M tests/language/language_dart2js.status View 2 chunks +0 lines, -10 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
karlklose
7 years, 3 months ago (2013-09-04 12:08:02 UTC) #1
ngeoffray
LGTM!
7 years, 3 months ago (2013-09-04 12:47:55 UTC) #2
karlklose
Committed patchset #4 manually as r27129 (presubmit successful).
7 years, 3 months ago (2013-09-04 13:45:55 UTC) #3
ahe
7 years, 3 months ago (2013-09-05 08:35:20 UTC) #4
Message was sent while issue was closed.
Nice example!

https://codereview.chromium.org/23583035/diff/8001/sdk/lib/_internal/compiler...
File sdk/lib/_internal/compiler/implementation/warnings.dart (right):

https://codereview.chromium.org/23583035/diff/8001/sdk/lib/_internal/compiler...
sdk/lib/_internal/compiler/implementation/warnings.dart:504: "Error: Cannot
return a value from a constructor.",
Prefer "can't" over "cannot" (the guidelines were updated based on feedback from
usability experts and tech writers).

Powered by Google App Engine
This is Rietveld 408576698