Skip to content

Commit f46efc7

Browse files
creliercommit-bot@chromium.org
authored andcommitted
[VM/nnbd] Do not apply legacy erasure to type literals.
See issue #42262. Change-Id: I326eff8ca836c345caab266f5d27991b251e77ba Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151020 Reviewed-by: Alexander Markov <[email protected]> Commit-Queue: Régis Crelier <[email protected]>
1 parent ab034e6 commit f46efc7

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

runtime/vm/compiler/frontend/constant_reader.cc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -303,9 +303,8 @@ InstancePtr ConstantReader::ReadConstantInternal(intptr_t constant_offset) {
303303
}
304304
case kTypeLiteralConstant: {
305305
// Build type from the raw bytes (needs temporary translator).
306-
TypeTranslator type_translator(
307-
&reader, this, active_class_, true,
308-
active_class_->RequireLegacyErasure(null_safety));
306+
// Legacy erasure is not applied to type literals. See issue #42262.
307+
TypeTranslator type_translator(&reader, this, active_class_, true);
309308
instance = type_translator.BuildType().raw();
310309
break;
311310
}

0 commit comments

Comments
 (0)