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

Issue 8534001: Adds typechecking of return values (Closed)

Created:
9 years, 1 month ago by Jennifer Messerly
Modified:
9 years, 1 month ago
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Adds typechecking of return values Also fixes places in frog where we were returning things from "void" methods. Committed: https://code.google.com/p/dart/source/detail?r=1443

Patch Set 1 #

Patch Set 2 : better runtime checks #

Total comments: 1

Patch Set 3 : merged #

Total comments: 15
Unified diffs Side-by-side diffs Delta from patch set Stats (+339 lines, -221 lines) Patch
M frog/corejs.dart View 1 1 chunk +2 lines, -4 lines 1 comment Download
M frog/frogsh View 1 2 170 chunks +296 lines, -197 lines 1 comment Download
M frog/gen.dart View 1 2 1 chunk +4 lines, -1 line 2 comments Download
M frog/lib/corelib_impl.dart View 1 1 chunk +3 lines, -3 lines 3 comments Download
M frog/member.dart View 4 chunks +13 lines, -10 lines 0 comments Download
M frog/type.dart View 2 chunks +4 lines, -3 lines 4 comments Download
M frog/value.dart View 1 2 2 chunks +15 lines, -1 line 2 comments Download
M tests/corelib/src/SortHelper.dart View 1 1 chunk +1 line, -1 line 1 comment Download
M tests/language/src/ContextArgsWithDefaultsTest.dart View 1 1 chunk +1 line, -1 line 1 comment Download

Messages

Total messages: 5 (0 generated)
Jennifer Messerly
tbr. Pretty straightforward. http://codereview.chromium.org/8534001/diff/2001/frog/lib/corelib_impl.dart File frog/lib/corelib_impl.dart (right): http://codereview.chromium.org/8534001/diff/2001/frog/lib/corelib_impl.dart#newcode238 frog/lib/corelib_impl.dart:238: const JSSyntaxRegExp(String pattern, [bool multiLine, bool ...
9 years, 1 month ago (2011-11-11 02:36:01 UTC) #1
Siggi Cherem (dart-lang)
http://codereview.chromium.org/8534001/diff/3010/frog/frogsh File frog/frogsh (right): http://codereview.chromium.org/8534001/diff/3010/frog/frogsh#newcode112 frog/frogsh:112: return typeof(test) == 'boolean' ? test : test.is$bool(); I ...
9 years, 1 month ago (2011-11-11 08:23:53 UTC) #2
jimhug
LGTM! One line change to enable return type checks - followed by a lot more ...
9 years, 1 month ago (2011-11-11 15:02:02 UTC) #3
Jennifer Messerly
http://codereview.chromium.org/8534001/diff/3010/frog/lib/corelib_impl.dart File frog/lib/corelib_impl.dart (right): http://codereview.chromium.org/8534001/diff/3010/frog/lib/corelib_impl.dart#newcode239 frog/lib/corelib_impl.dart:239: this._create(pattern, On 2011/11/11 15:02:02, jimhug wrote: > I agree ...
9 years, 1 month ago (2011-11-11 18:23:55 UTC) #4
Jennifer Messerly
9 years, 1 month ago (2011-11-11 18:38:05 UTC) #5
http://codereview.chromium.org/8534001/diff/3010/frog/type.dart
File frog/type.dart (right):

http://codereview.chromium.org/8534001/diff/3010/frog/type.dart#newcode313
frog/type.dart:313: Map<String, MethodMember> get constructors() {
On 2011/11/11 15:02:02, jimhug wrote:
> Is this required or just good style?

internalError has a return type of "void". If we changed its return type to
"var" I could keep the =>. Let me know which you prefer.

http://codereview.chromium.org/8534001/diff/3010/frog/type.dart#newcode532
frog/type.dart:532: void set parent(Type p) { _parent = p; }
On 2011/11/11 15:02:02, jimhug wrote:
> Same question here - can we use => on void methods?

Yup, you can use => on void methods if the RHS type is also void or var.

"_parent = p" returns "Type" which is not a subtype of "void". Looking at this
again though, maybe the bug is in the setter's return type--should it be Type?
Do we rely on setters returning the correct value to make things like "o.a = o.b
= 42" work?

Powered by Google App Engine
This is Rietveld 408576698