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

Issue 1179343004: Refactor least upper bound computation; support bottom correctly. (Closed)

Created:
5 years, 6 months ago by Paul Berry
Modified:
5 years, 6 months ago
Reviewers:
Brian Wilkerson
CC:
reviews_dartlang.org
Base URL:
git@github.com:dart-lang/sdk.git@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Refactor 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
Unified diffs Side-by-side diffs Delta from patch set Stats (+585 lines, -56 lines) Patch
M pkg/analyzer/lib/src/generated/constant.dart View 5 chunks +18 lines, -6 lines 1 comment Download
M pkg/analyzer/lib/src/generated/element.dart View 10 chunks +75 lines, -43 lines 0 comments Download
M pkg/analyzer/lib/src/generated/resolver.dart View 1 chunk +108 lines, -0 lines 1 comment Download
M pkg/analyzer/lib/src/generated/static_type_analyzer.dart View 7 chunks +14 lines, -5 lines 0 comments Download
M pkg/analyzer/lib/src/generated/testing/element_factory.dart View 1 chunk +5 lines, -2 lines 0 comments Download
M pkg/analyzer/test/generated/static_type_warning_code_test.dart View 1 chunk +6 lines, -0 lines 0 comments Download
M pkg/analyzer/test/generated/test_all.dart View 2 chunks +2 lines, -0 lines 0 comments Download
A pkg/analyzer/test/generated/type_system_test.dart View 1 chunk +357 lines, -0 lines 0 comments Download

Messages

Total messages: 4 (1 generated)
Paul Berry
5 years, 6 months ago (2015-06-16 21:14:34 UTC) #2
Brian Wilkerson
LGTM https://codereview.chromium.org/1179343004/diff/1/pkg/analyzer/lib/src/generated/constant.dart File pkg/analyzer/lib/src/generated/constant.dart (right): https://codereview.chromium.org/1179343004/diff/1/pkg/analyzer/lib/src/generated/constant.dart#newcode220 pkg/analyzer/lib/src/generated/constant.dart:220: * The type system. This is used to ...
5 years, 6 months ago (2015-06-16 21:35:19 UTC) #3
Paul Berry
5 years, 6 months ago (2015-06-17 17:10:40 UTC) #4
Message was sent while issue was closed.
Committed patchset #1 (id:1) manually as
13c3c10f22bc1e4432dc52e66838b3339d9a588b (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698