From 7d2b344a7e6ed52a2d3fefe77fed5c2030f62e8c Mon Sep 17 00:00:00 2001 From: Chloe Stefantsova Date: Mon, 11 May 2026 04:46:43 -0700 Subject: [PATCH] [cfe] Fix printing of catch clauses with new CatchVariables Since `CatchVariable`s don't have initializers, the print method in the `Catch` node shouldn't attempt to print it. Part of https://github.com/dart-lang/sdk/issues/61572 Change-Id: I548e80e0f95c20a0537392faccd5c1fc11d844d2 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/497980 Reviewed-by: Johnni Winther Commit-Queue: Chloe Stefantsova --- pkg/kernel/lib/src/ast/statements.dart | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/kernel/lib/src/ast/statements.dart b/pkg/kernel/lib/src/ast/statements.dart index 09001d95923..9943fa699f5 100644 --- a/pkg/kernel/lib/src/ast/statements.dart +++ b/pkg/kernel/lib/src/ast/statements.dart @@ -1326,6 +1326,7 @@ class Catch extends TreeNode implements ScopeProvider { printer.writeVariableInitialization( exception!, includeModifiersAndType: false, + includeInitializer: false, ); if (stackTrace != null) { printer.write(', ');