diff --git a/sdk_nnbd/lib/_internal/js_dev_runtime/private/ddc_runtime/types.dart b/sdk_nnbd/lib/_internal/js_dev_runtime/private/ddc_runtime/types.dart index 2733439fd16f6..318a96a50ec08 100644 --- a/sdk_nnbd/lib/_internal/js_dev_runtime/private/ddc_runtime/types.dart +++ b/sdk_nnbd/lib/_internal/js_dev_runtime/private/ddc_runtime/types.dart @@ -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('!', '#.hasOwnProperty(#)', type, _cachedLegacy)) { - return JS('!', '#[#]', type, _cachedLegacy); + return JS('!', '#[#]', type, _cachedLegacy); } // Cache a canonical legacy version of this type on this type. var cachedType = LegacyType(type);