Chromium Code Reviews
DescriptionFix least upper bound computation for generic types (dartbug.com/15060)
Consider the classes:
class A<T> {}
class B<T> extends A<T>
class C<T> extends A<T>
class D {}
class E {}
When computing the least upper bound of B<D> and C<E>, we were making
two mistakes:
1. When computing superclasses we were using
ClassElement.getSupertype() (which doesn't substitute type arguments),
so B<D> and C<E> were considered to derive from a common type A<T>
rather than distinct types A<D> and A<E>. A similar problem existed
for interfaces.
2. When intersecting superinterface sets, we were recursively taking
the least upper bound of type arguments, so A<D> and A<E> were
coalesced into A<Object>. The spec and VM consider A<D> and A<E> to
be unrelated types for the purpose of least upper bound computation,
so the least upper bound should simply be Object.
R=brianwilkerson@google.com
Committed: https://code.google.com/p/dart/source/detail?r=34952
Patch Set 1 #
Messages
Total messages: 3 (0 generated)
|
|||||||||||||||||||||||||||||||||||||