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

Issue 234213002: Fix least upper bound computation for generic types (dartbug.com/15060) (Closed)

Created:
6 years, 8 months ago by Paul Berry
Modified:
6 years, 8 months ago
Reviewers:
jwren, Brian Wilkerson
CC:
reviews_dartlang.org, ricow1
Visibility:
Public.

Description

Fix 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 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+90 lines, -40 lines) Patch
M editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/type/InterfaceTypeImpl.java View 3 chunks +6 lines, -20 lines 0 comments Download
M editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/internal/type/InterfaceTypeImplTest.java View 2 chunks +84 lines, -3 lines 0 comments Download
M tests/language/language_analyzer.status View 1 chunk +0 lines, -17 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
Paul Berry
6 years, 8 months ago (2014-04-10 22:20:05 UTC) #1
Brian Wilkerson
LGTM
6 years, 8 months ago (2014-04-10 22:54:51 UTC) #2
Paul Berry
6 years, 8 months ago (2014-04-10 23:07:56 UTC) #3
Message was sent while issue was closed.
Committed patchset #1 manually as r34952 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698