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

Issue 26344006: Substitution for type variables in mirrors on instantiated generics. (Closed)

Created:
7 years, 2 months ago by rmacnak
Modified:
7 years, 2 months ago
Reviewers:
regis, gbracha
CC:
reviews_dartlang.org, vm-dev_dartlang.org
Visibility:
Public.

Description

Substitution for type variables in mirrors on instantiated generics. BUG=http://dartbug.com/12282 BUG=http://dartbug.com/13808 R=gbracha@google.com, regis@google.com Committed: https://code.google.com/p/dart/source/detail?r=28495

Patch Set 1 : #

Total comments: 22

Patch Set 2 : #

Patch Set 3 : #

Patch Set 4 : #

Patch Set 5 : #

Total comments: 7

Patch Set 6 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+120 lines, -31 lines) Patch
M runtime/lib/mirrors.cc View 1 2 3 4 5 10 chunks +66 lines, -10 lines 0 comments Download
M runtime/lib/mirrors_impl.dart View 1 11 chunks +43 lines, -4 lines 0 comments Download
M runtime/vm/bootstrap_natives.h View 2 chunks +2 lines, -0 lines 0 comments Download
M runtime/vm/object.h View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M runtime/vm/object.cc View 1 2 3 4 1 chunk +4 lines, -3 lines 0 comments Download
M tests/lib/lib.status View 1 2 3 4 5 1 chunk +2 lines, -11 lines 0 comments Download
M tests/lib/mirrors/generics_substitution_test.dart View 1 chunk +1 line, -1 line 0 comments Download
M tests/lib/mirrors/type_argument_is_type_variable_test.dart View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 14 (0 generated)
rmacnak
https://codereview.chromium.org/26344006/diff/11001/runtime/lib/mirrors_impl.dart File runtime/lib/mirrors_impl.dart (right): https://codereview.chromium.org/26344006/diff/11001/runtime/lib/mirrors_impl.dart#newcode489 runtime/lib/mirrors_impl.dart:489: ? _supertype(_reflectedType) Unfortunately, this is not the same as ...
7 years, 2 months ago (2013-10-09 01:15:00 UTC) #1
gbracha
lgtm
7 years, 2 months ago (2013-10-09 01:19:11 UTC) #2
regis
LGTM with some questions and comments https://codereview.chromium.org/26344006/diff/11001/runtime/lib/mirrors.cc File runtime/lib/mirrors.cc (right): https://codereview.chromium.org/26344006/diff/11001/runtime/lib/mirrors.cc#newcode875 runtime/lib/mirrors.cc:875: return super_type.raw(); You ...
7 years, 2 months ago (2013-10-09 15:46:51 UTC) #3
regis
On 2013/10/09 15:46:51, regis wrote: > LGTM with some questions and comments > > https://codereview.chromium.org/26344006/diff/11001/runtime/lib/mirrors.cc ...
7 years, 2 months ago (2013-10-09 15:50:07 UTC) #4
ahe
https://codereview.chromium.org/26344006/diff/11001/runtime/lib/mirrors_impl.dart File runtime/lib/mirrors_impl.dart (right): https://codereview.chromium.org/26344006/diff/11001/runtime/lib/mirrors_impl.dart#newcode489 runtime/lib/mirrors_impl.dart:489: ? _supertype(_reflectedType) On 2013/10/09 01:15:00, Ryan Macnak wrote: > ...
7 years, 2 months ago (2013-10-10 16:53:38 UTC) #5
rmacnak
PTAL. Now passing the bounds tests modulo an equality issue. https://codereview.chromium.org/26344006/diff/11001/runtime/lib/mirrors.cc File runtime/lib/mirrors.cc (right): https://codereview.chromium.org/26344006/diff/11001/runtime/lib/mirrors.cc#newcode875 ...
7 years, 2 months ago (2013-10-11 01:04:22 UTC) #6
rmacnak
On 2013/10/09 15:50:07, regis wrote: > I thought that you were hiding the fact that ...
7 years, 2 months ago (2013-10-11 01:06:37 UTC) #7
regis
LGTM https://codereview.chromium.org/26344006/diff/27001/runtime/lib/mirrors.cc File runtime/lib/mirrors.cc (right): https://codereview.chromium.org/26344006/diff/27001/runtime/lib/mirrors.cc#newcode889 runtime/lib/mirrors.cc:889: ASSERT(super_type.IsFinalized()); You could write ASSERT(!super_type.IsType() || super_type.IsFinalized()); But ...
7 years, 2 months ago (2013-10-11 01:28:59 UTC) #8
rmacnak
https://codereview.chromium.org/26344006/diff/27001/runtime/lib/mirrors.cc File runtime/lib/mirrors.cc (right): https://codereview.chromium.org/26344006/diff/27001/runtime/lib/mirrors.cc#newcode889 runtime/lib/mirrors.cc:889: ASSERT(super_type.IsFinalized()); On 2013/10/11 01:28:59, regis wrote: > You could ...
7 years, 2 months ago (2013-10-11 01:48:01 UTC) #9
rmacnak
Committed patchset #6 manually as r28495 (presubmit successful).
7 years, 2 months ago (2013-10-11 01:51:18 UTC) #10
ahe
https://codereview.chromium.org/26344006/diff/11001/runtime/lib/mirrors_impl.dart File runtime/lib/mirrors_impl.dart (right): https://codereview.chromium.org/26344006/diff/11001/runtime/lib/mirrors_impl.dart#newcode489 runtime/lib/mirrors_impl.dart:489: ? _supertype(_reflectedType) On 2013/10/11 01:04:22, Ryan Macnak wrote: > ...
7 years, 2 months ago (2013-10-11 12:43:33 UTC) #11
rmacnak
On 2013/10/11 12:43:33, ahe wrote: > https://codereview.chromium.org/26344006/diff/11001/runtime/lib/mirrors_impl.dart > File runtime/lib/mirrors_impl.dart (right): > > https://codereview.chromium.org/26344006/diff/11001/runtime/lib/mirrors_impl.dart#newcode489 > ...
7 years, 2 months ago (2013-10-11 22:12:44 UTC) #12
ahe
On 2013/10/11 22:12:44, Ryan Macnak wrote: > On 2013/10/11 12:43:33, ahe wrote: > > > ...
7 years, 2 months ago (2013-10-14 12:21:04 UTC) #13
rmacnak
7 years, 2 months ago (2013-10-14 16:50:14 UTC) #14
Message was sent while issue was closed.
On 2013/10/14 12:21:04, ahe wrote:
> On 2013/10/11 22:12:44, Ryan Macnak wrote:
> > On 2013/10/11 12:43:33, ahe wrote:
> > >
> >
>
https://codereview.chromium.org/26344006/diff/11001/runtime/lib/mirrors_impl....
> > > File runtime/lib/mirrors_impl.dart (right):
> > > 
> > >
> >
>
https://codereview.chromium.org/26344006/diff/11001/runtime/lib/mirrors_impl....
> > > runtime/lib/mirrors_impl.dart:489: ? _supertype(_reflectedType)
> > > On 2013/10/11 01:04:22, Ryan Macnak wrote:
> > > > On 2013/10/10 16:53:38, ahe wrote:
> > > > > On 2013/10/09 01:15:00, Ryan Macnak wrote:
> > > > > > Unfortunately, this is not the same as reflecting on the
instantiated
> > > > > supertype
> > > > > > and getting its original declaration.
> > > > > 
> > > > > Why?
> > > > 
> > > > Consider
> > > > class S<T>
> > > > class C<R> extends S<R>
> > > > 
> > > > The superclass of the declaration of C is S<R>, not the declaration of
S.
> > > 
> > > I'm not sure I understand this. What is the difference between _supertype
> and
> > > _supertypeInstantiated?
> > 
> > supertype(C<int>) = S<R>
> > supertypeInstanitated(C<int>) = S<int>
> 
> So the problem is that _reflectedType is C<dynamic> when isOriginalDeclaration
> is true, which leads to S<dynamic> if you don't have this special case?

Yes.

Powered by Google App Engine
This is Rietveld 408576698