[front_end,kernel] Add ignores for codegen to prepare for new syntax.

(Part of https://github.com/dart-lang/sdk/issues/63288)

Updates various code generators in the `front_end` and `kernel`
packages to output `ignore_for_file` comments to ignore the
`unnecessary_type_name_in_constructor` lint.

This is a first step towards migrating the `front_end` and `kernel`
packages to use the new constructor declaration syntax, since it will
allow the `unnecessary_type_name_in_constructor` lint to be enabled
without breaking generated code.

Once all the packages have had their SDK constraints bumped to a
language version that supports the new syntax, I'll update the code
generator to use the new syntax, and remove the ignores.

For more information about the new constructor declaration syntax, see
https://github.com/dart-lang/language/blob/main/accepted/future-releases/primary-constructors/feature-specification.md#abbreviations-of-in-body-constructor-declarations.

Change-Id: I73fd960a7eea2a1a59316602c49d56816a6a6964
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/506380
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
This commit is contained in:
Paul Berry
2026-05-27 10:11:50 -07:00
committed by dart-scoped@luci-project-accounts.iam.gserviceaccount.com
parent 0fa39c9649
commit 49597f85d9
10 changed files with 69 additions and 4 deletions
+2
View File
@@ -6,6 +6,8 @@
//
// Run 'dart pkg/front_end/tool/generate_ast_equivalence.dart' to update.
// ignore_for_file: unnecessary_type_name_in_constructor
import 'package:kernel/ast.dart';
import 'package:kernel/src/printer.dart';
import 'union_find.dart';