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

Issue 10387033: Add VoidElement and VoidType to make sure that there is a canonical void type. (Closed)

Created:
8 years, 7 months ago by karlklose
Modified:
8 years, 7 months ago
Reviewers:
ngeoffray
CC:
reviews_dartlang.org, kasperl
Visibility:
Public.

Description

This fixes a wrong warning about void functions in which not all paths leads to return or throw statement. TEST=added to type_checker_test R=ngeoffray@google.com Committed: https://code.google.com/p/dart/source/detail?r=7449

Patch Set 1 #

Total comments: 6

Patch Set 2 : Address review comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+26 lines, -5 lines) Patch
M frog/tests/leg/type_checker_test.dart View 1 1 chunk +2 lines, -0 lines 0 comments Download
M lib/compiler/implementation/elements/elements.dart View 1 2 chunks +12 lines, -0 lines 0 comments Download
M lib/compiler/implementation/typechecker.dart View 1 5 chunks +12 lines, -5 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
karlklose
8 years, 7 months ago (2012-05-09 08:36:15 UTC) #1
ngeoffray
LGTM http://codereview.chromium.org/10387033/diff/1/frog/tests/leg/type_checker_test.dart File frog/tests/leg/type_checker_test.dart (right): http://codereview.chromium.org/10387033/diff/1/frog/tests/leg/type_checker_test.dart#newcode241 frog/tests/leg/type_checker_test.dart:241: analyzeTopLevel("var foo() { if (true) { return; } ...
8 years, 7 months ago (2012-05-09 08:54:40 UTC) #2
karlklose
8 years, 7 months ago (2012-05-09 10:32:41 UTC) #3
Thanks, Nicolas.

http://codereview.chromium.org/10387033/diff/1/frog/tests/leg/type_checker_te...
File frog/tests/leg/type_checker_test.dart (right):

http://codereview.chromium.org/10387033/diff/1/frog/tests/leg/type_checker_te...
frog/tests/leg/type_checker_test.dart:241: analyzeTopLevel("var foo() { if
(true) { return; } }");
Done, removed type.

http://codereview.chromium.org/10387033/diff/1/lib/compiler/implementation/el...
File lib/compiler/implementation/elements/elements.dart (right):

http://codereview.chromium.org/10387033/diff/1/lib/compiler/implementation/el...
lib/compiler/implementation/elements/elements.dart:671: : super(Types.VOID,
ElementKind.VOID, enclosing);
On 2012/05/09 08:54:40, ngeoffray wrote:
> Please add return types to the methods below.

Done.

http://codereview.chromium.org/10387033/diff/1/lib/compiler/implementation/ty...
File lib/compiler/implementation/typechecker.dart (right):

http://codereview.chromium.org/10387033/diff/1/lib/compiler/implementation/ty...
lib/compiler/implementation/typechecker.dart:597:
!types.isAssignable(expressionType, types.voidType)) {
We certainly do not follow it everywhere in our code. But I am fine with either.
Reverted.

Powered by Google App Engine
This is Rietveld 408576698