Chromium Code Reviews
DescriptionRefactor least upper bound computation; support bottom correctly.
Previously, the least upper bound code was only half-written--it
computed correct results if both types were interface types, and
otherwise returned null. Now we always return a non-null type.
Unfortunately, the full least upper bound algorithm in the spec
requires referencing types not reachable from the types being
compared; thus in order to execute it we need access to the
TypeProvider. We can't do this with the existing API. So that API
has been deprecated. The new API uses a class TypeSystem which
contains a pointer to the TypeProvider. This new class should also be
a useful starting point in case we need to make the type system more
pluggable in the future.
Clients that use the old API will see no change in behavior--they will
still get the half-written algorithm.
Still to be addressed in future CL's:
- Deprecate getSmartLeastUpperBound.
- Fix calls to getLeastUpperBound and getSmartLeastUpperBound in analysis
server.
- Implement least upper bound computation for function types.
- Make sure type parameters function correctly in the presence of F-bounded
polymorphism.
- Implement shared tests.
R=brianwilkerson@google.com
Committed: https://github.com/dart-lang/sdk/commit/13c3c10f22bc1e4432dc52e66838b3339d9a588b
Patch Set 1 #
Total comments: 2
Messages
Total messages: 4 (1 generated)
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||