From da2dc44dda58c24dfd3664117579f7d0aaa8cfaa Mon Sep 17 00:00:00 2001 From: Danny Tuppeny Date: Mon, 6 Apr 2026 10:14:22 -0700 Subject: [PATCH] [analysis_server] Add test that convert_to_expression_body doesn't show for primary constructor bodies Fixes https://github.com/dart-lang/sdk/issues/63042 Change-Id: Ib6402b03b9a5854e9fd33332ed6b32e966c192bb Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/493140 Reviewed-by: Keerti Parthasarathy Reviewed-by: Brian Wilkerson Commit-Queue: Keerti Parthasarathy --- .../convert_into_expression_body_test.dart | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/pkg/analysis_server/test/src/services/correction/assist/convert_into_expression_body_test.dart b/pkg/analysis_server/test/src/services/correction/assist/convert_into_expression_body_test.dart index ca39c1031eb..aad1987bc25 100644 --- a/pkg/analysis_server/test/src/services/correction/assist/convert_into_expression_body_test.dart +++ b/pkg/analysis_server/test/src/services/correction/assist/convert_into_expression_body_test.dart @@ -294,6 +294,24 @@ var ^V = 42; await assertNoAssist(); } + Future test_primaryConstructorBody_brace() async { + await resolveTestCode(''' +class A() { + this ^{} +} +'''); + await assertNoAssist(); + } + + Future test_primaryConstructorBody_keyword() async { + await resolveTestCode(''' +class A() { + ^this {} +} +'''); + await assertNoAssist(); + } + Future test_topFunction_onReturnStatement() async { await resolveTestCode(''' fff() {