diff --git a/pkg/compiler/lib/src/commandline_options.dart b/pkg/compiler/lib/src/commandline_options.dart index 2d1a703dd8b..81e613c6770 100644 --- a/pkg/compiler/lib/src/commandline_options.dart +++ b/pkg/compiler/lib/src/commandline_options.dart @@ -99,7 +99,6 @@ class Flags { static const String noOmitLateNames = '--no-omit-late-names'; static const String preserveUris = '--preserve-uris'; - static const String printLegacyStars = '--debug-print-legacy-stars'; static const String showPackageWarnings = '--show-package-warnings'; static const String suppressHints = '--suppress-hints'; static const String suppressWarnings = '--suppress-warnings'; diff --git a/pkg/compiler/lib/src/dart2js.dart b/pkg/compiler/lib/src/dart2js.dart index fab990f193b..3e1c23a7e33 100644 --- a/pkg/compiler/lib/src/dart2js.dart +++ b/pkg/compiler/lib/src/dart2js.dart @@ -450,7 +450,6 @@ Future compile( _OneOption(Flags.omitLateNames, passThrough), _OneOption(Flags.noOmitLateNames, passThrough), _OneOption(Flags.preserveUris, ignoreOption), - _OneOption(Flags.printLegacyStars, passThrough), _OneOption('--force-strip=.*', setStrip), _OneOption(Flags.disableDiagnosticColors, (_) { enableColors = false; diff --git a/pkg/compiler/lib/src/kernel/transformations/global/js_get_flag_lowering.dart b/pkg/compiler/lib/src/kernel/transformations/global/js_get_flag_lowering.dart index 91f2fd623b0..ceade37d48a 100644 --- a/pkg/compiler/lib/src/kernel/transformations/global/js_get_flag_lowering.dart +++ b/pkg/compiler/lib/src/kernel/transformations/global/js_get_flag_lowering.dart @@ -59,7 +59,6 @@ class JsGetFlagLowering { _options.features.useContentSecurityPolicy.isEnabled, 'VARIANCE' => _options.enableVariance, 'LEGACY' => _options.useLegacySubtyping, - 'PRINT_LEGACY_STARS' => _options.printLegacyStars, _ => null, }; diff --git a/pkg/compiler/lib/src/options.dart b/pkg/compiler/lib/src/options.dart index 45e6d158946..145ecc8e61a 100644 --- a/pkg/compiler/lib/src/options.dart +++ b/pkg/compiler/lib/src/options.dart @@ -552,9 +552,6 @@ class CompilerOptions implements DiagnosticOptions { /// Location of the kernel platform `.dill` files. Uri? platformBinaries; - /// Whether to print legacy types as T* rather than T. - bool printLegacyStars = false; - /// URI where the compiler should generate the output source map file. Uri? sourceMapUri; @@ -934,7 +931,6 @@ class CompilerOptions implements DiagnosticOptions { ..generateSourceMap = !_hasOption(options, Flags.noSourceMaps) .._outputUri = _extractUriOption(options, '--out=') ..platformBinaries = platformBinaries - ..printLegacyStars = _hasOption(options, Flags.printLegacyStars) ..sourceMapUri = _extractUriOption(options, '--source-map=') ..omitImplicitChecks = _hasOption(options, Flags.omitImplicitChecks) ..omitAsCasts = _hasOption(options, Flags.omitAsCasts) diff --git a/pkg/dev_compiler/lib/src/kernel/compiler.dart b/pkg/dev_compiler/lib/src/kernel/compiler.dart index 744e580909b..138e76629eb 100644 --- a/pkg/dev_compiler/lib/src/kernel/compiler.dart +++ b/pkg/dev_compiler/lib/src/kernel/compiler.dart @@ -6152,9 +6152,8 @@ class ProgramCompiler extends ComputeOnceConstantVisitor var value = flag.value; return switch (value) { 'DEV_COMPILER' => js.boolean(true), - // TODO(nshahan): Delete 'PRINT_LEGACY_STARS' and 'LEGACY' after - // uses are deleted from dart:_rti. - 'PRINT_LEGACY_STARS' => js.boolean(false), + // TODO(nshahan): Delete 'LEGACY' after uses are deleted from + // dart:_rti. 'LEGACY' => js.boolean(false), 'MINIFIED' => js.boolean(false), 'VARIANCE' => diff --git a/pkg/dev_compiler/lib/src/kernel/compiler_new.dart b/pkg/dev_compiler/lib/src/kernel/compiler_new.dart index 7dc3a7a0f5b..fc3be58e4fb 100644 --- a/pkg/dev_compiler/lib/src/kernel/compiler_new.dart +++ b/pkg/dev_compiler/lib/src/kernel/compiler_new.dart @@ -6600,9 +6600,8 @@ class LibraryCompiler extends ComputeOnceConstantVisitor var value = flag.value; return switch (value) { 'DEV_COMPILER' => js.boolean(true), - // TODO(nshahan): Delete 'PRINT_LEGACY_STARS' and 'LEGACY' after - // uses are deleted from dart:_rti. - 'PRINT_LEGACY_STARS' => js.boolean(false), + // TODO(nshahan): Delete 'LEGACY' after uses are deleted from + // dart:_rti. 'LEGACY' => js.boolean(false), 'MINIFIED' => js.boolean(false), 'VARIANCE' => diff --git a/sdk/lib/_internal/js_shared/lib/rti.dart b/sdk/lib/_internal/js_shared/lib/rti.dart index b8bcb1ea30e..75ce58e770d 100644 --- a/sdk/lib/_internal/js_shared/lib/rti.dart +++ b/sdk/lib/_internal/js_shared/lib/rti.dart @@ -410,9 +410,6 @@ class Rti { // TODO(nshahan): Make private and change the argument type to rti once this // method is no longer called from outside the library. Rti getLegacyErasedRti(Object? rti) { - // When preserving the legacy stars in the runtime type no legacy erasure - // happens so the cached version cannot be used. - assert(!JS_GET_FLAG('PRINT_LEGACY_STARS')); var originalType = _Utils.asRti(rti); return Rti._getCachedRuntimeType(originalType)?._rti ?? _createAndCacheRuntimeType(originalType)._rti; @@ -1181,9 +1178,6 @@ _Type _createAndCacheRuntimeType(Rti rti) { } _Type _createRuntimeType(Rti rti) { - if (JS_GET_FLAG('PRINT_LEGACY_STARS')) { - return _Type(rti); - } String recipe = Rti._getCanonicalRecipe(rti); String starErasedRecipe = Rti.getLegacyErasedRecipe(rti); if (starErasedRecipe == recipe) { @@ -1996,16 +1990,7 @@ String _rtiToString(Rti rti, List? genericContext) { if (kind == Rti.kindStar) { Rti starArgument = Rti._getStarArgument(rti); String s = _rtiToString(starArgument, genericContext); - if (JS_GET_FLAG('PRINT_LEGACY_STARS')) { - int argumentKind = Rti._getKind(starArgument); - if (argumentKind == Rti.kindFunction || - argumentKind == Rti.kindGenericFunction) { - s = '(' + s + ')'; - } - return s + '*'; - } else { - return s; - } + return s; } if (kind == Rti.kindQuestion) {