From 8af6a165f29b6277ba54d271eaec621bc08fb4a0 Mon Sep 17 00:00:00 2001 From: Dimitra <249443816+dimitrakokkali@users.noreply.github.com> Date: Wed, 15 Jul 2026 17:03:32 +0300 Subject: [PATCH] [compiler] Fix empty primary constructor --- .../Parser/XSharpTreeTransformationCore.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Compiler/src/Compiler/XSharpCodeAnalysis/Parser/XSharpTreeTransformationCore.cs b/src/Compiler/src/Compiler/XSharpCodeAnalysis/Parser/XSharpTreeTransformationCore.cs index 896ab2283a..df1b1778b1 100644 --- a/src/Compiler/src/Compiler/XSharpCodeAnalysis/Parser/XSharpTreeTransformationCore.cs +++ b/src/Compiler/src/Compiler/XSharpCodeAnalysis/Parser/XSharpTreeTransformationCore.cs @@ -3094,7 +3094,8 @@ public override void ExitClass_([NotNull] XP.Class_Context context) var members = GetMembers(context, context._Members); var baseTypes = GetBaseTypes(context.BaseType?.Get(), context._Implements); - var primeParam = getParameters(context.ParamList); + ParameterListSyntax primeParam = null; + if (context.ParamList != null) primeParam = getParameters(context.ParamList); MemberDeclarationSyntax m; if (isRecord) @@ -3210,7 +3211,8 @@ public override void ExitStructure_([NotNull] XP.Structure_Context context) } var members = GetMembers(context, context._Members); var baseTypes = GetBaseTypes(null, context._Implements); - var primeParam = getParameters(context.ParamList); + ParameterListSyntax primeParam = null; + if (context.ParamList != null) primeParam = getParameters(context.ParamList); MemberDeclarationSyntax m; if (isRecord)