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

Issue 10933039: Make int an abstract class. (Closed)

Created:
8 years, 3 months ago by Lasse Reichstein Nielsen
Modified:
8 years, 3 months ago
Reviewers:
regis, srdjan, hausner
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Make int an abstract class. This looks deceptively simple (the only real change is in init, which just copies the code for double, and the rest are just renaming for consistency). It seems to work. Committed: https://code.google.com/p/dart/source/detail?r=12304

Patch Set 1 #

Patch Set 2 : Make extending int an error too. #

Patch Set 3 : Make extending int an error too. #

Total comments: 1

Patch Set 4 : Now with correct base. #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+32 lines, -29 lines) Patch
M lib/core/int.dart View 1 chunk +1 line, -1 line 0 comments Download
M runtime/vm/class_finalizer.cc View 1 2 chunks +3 lines, -2 lines 2 comments Download
M runtime/vm/dart_api_message.cc View 1 chunk +1 line, -1 line 0 comments Download
M runtime/vm/flow_graph_compiler.cc View 1 chunk +1 line, -1 line 0 comments Download
M runtime/vm/flow_graph_compiler_ia32.cc View 1 chunk +1 line, -1 line 0 comments Download
M runtime/vm/flow_graph_compiler_x64.cc View 1 chunk +1 line, -1 line 0 comments Download
M runtime/vm/intermediate_language.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M runtime/vm/intrinsifier_ia32.cc View 1 chunk +1 line, -1 line 0 comments Download
M runtime/vm/object.h View 2 chunks +4 lines, -4 lines 0 comments Download
runtime/vm/object.cc View 3 chunks +8 lines, -6 lines 0 comments Download
M runtime/vm/object_store.h View 2 chunks +4 lines, -4 lines 0 comments Download
M runtime/vm/object_store.cc View 1 chunk +1 line, -1 line 0 comments Download
M runtime/vm/parser.cc View 1 chunk +1 line, -1 line 0 comments Download
M runtime/vm/snapshot.cc View 2 chunks +3 lines, -3 lines 0 comments Download
M runtime/vm/snapshot_ids.h View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 8 (0 generated)
Lasse Reichstein Nielsen
If it isn't this simple, I'll stop trying :)
8 years, 3 months ago (2012-09-12 08:07:46 UTC) #1
Lasse Reichstein Nielsen
Sorry about the spam uploading. CL was making a fuzz.
8 years, 3 months ago (2012-09-12 11:01:54 UTC) #2
Lasse Reichstein Nielsen
https://chromiumcodereview.appspot.com/10933039/diff/5001/runtime/vm/object.cc File runtime/vm/object.cc (right): https://chromiumcodereview.appspot.com/10933039/diff/5001/runtime/vm/object.cc#newcode2735 runtime/vm/object.cc:2735: RawType* Type::IntType() { Why is it Type::BoolType but Type::Double? ...
8 years, 3 months ago (2012-09-12 11:03:24 UTC) #3
srdjan
LGTM from my part, but I'd like Matthias and Regis (added him to the list ...
8 years, 3 months ago (2012-09-12 11:59:47 UTC) #4
hausner
LGTM 2 I feared int would be harder to convert. Nice job!
8 years, 3 months ago (2012-09-12 15:55:42 UTC) #5
regis
LGTM A general comment, not specific to this cl: It would be nice to use ...
8 years, 3 months ago (2012-09-12 16:30:25 UTC) #6
Lasse Reichstein Nielsen
https://chromiumcodereview.appspot.com/10933039/diff/8001/runtime/vm/class_finalizer.cc File runtime/vm/class_finalizer.cc (right): https://chromiumcodereview.appspot.com/10933039/diff/8001/runtime/vm/class_finalizer.cc#newcode305 runtime/vm/class_finalizer.cc:305: Type::Handle(Type::IntType()).type_class() == super_class.raw()) { I think it worked for ...
8 years, 3 months ago (2012-09-13 07:19:21 UTC) #7
Lasse Reichstein Nielsen
8 years, 3 months ago (2012-09-13 07:38:41 UTC) #8
On 2012/09/12 16:30:25, regis wrote:
> I would expect we need to restrict implementing the bool interface
> as we do for int and double, but the code is different and I am not
> sure why.

True, bool is also a class, and it's prevented from being extended and
implemented too, without this extra line.

You also need to prevent extending and implementing Null. (There should be a
Null class in the core library, which there isn't now for some reason. I'll
probably add it soon and see how much will crash :).



/L

Powered by Google App Engine
This is Rietveld 408576698