Skip to content

Commit

Permalink
[dartdevc] Normalizing legacy null to null.
Browse files Browse the repository at this point in the history
Change-Id: I3d0ede71e4e979e060e0c8aeed4760cf1e6ceee4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133002
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
  • Loading branch information
Markzipan authored and commit-bot@chromium.org committed Jan 23, 2020
1 parent 90b74dc commit 3679239
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -268,12 +268,12 @@ Object nullable(type) {
// TODO(nshahan): Update after the normalization doc PR lands.
@notNull
Object legacy(type) {
// TODO(nshahan) Maybe normailize never*, Null*.
if (_isLegacy(type) || _isNullable(type) || _isTop(type)) return type;
if (_isLegacy(type) || _isNullable(type) || _isTop(type) || _isNullType(type))
return type;

// Check if a legacy version of this type has already been created.
if (JS<bool>('!', '#.hasOwnProperty(#)', type, _cachedLegacy)) {
return JS<NullableType>('!', '#[#]', type, _cachedLegacy);
return JS<LegacyType>('!', '#[#]', type, _cachedLegacy);
}
// Cache a canonical legacy version of this type on this type.
var cachedType = LegacyType(type);
Expand Down

0 comments on commit 3679239

Please sign in to comment.