Skip to content

Commit

Permalink
Fixed generation of state variables in Variants.
Browse files Browse the repository at this point in the history
  • Loading branch information
vchelaru committed Feb 22, 2024
1 parent 6a3ad86 commit f824632
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions FRBDK/Glue/Glue/CodeGeneration/CustomVariableCodeGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public static ICodeBlock AppendCodeForMember(GlueElement saveObject, ICodeBlock
shouldGenerateDueToExposed = shouldGenerateDueToExposed || forceGenerateExposed;
if (shouldGenerateDueToExposed)
{
CreateNewVariableMember(codeBlock, customVariable, isExposedExistingMember, saveObject);
CreateNewVariableMember(codeBlock, customVariable, isExposedExistingMember, saveObject, forceGenerateExposed);
}
}
#endregion
Expand Down Expand Up @@ -164,7 +164,7 @@ private static void AppendPropertyForTunneledVariable(IElement saveObject, ICode
}
}

private static void CreateNewVariableMember(ICodeBlock codeBlock, CustomVariable customVariable, bool isExposing, GlueElement element)
private static void CreateNewVariableMember(ICodeBlock codeBlock, CustomVariable customVariable, bool isExposing, GlueElement element, bool forceGenerate = false)
{
string variableAssignment = "";

Expand Down Expand Up @@ -378,6 +378,13 @@ private static void CreateNewVariableMember(ICodeBlock codeBlock, CustomVariable
codeBlock.Line(line);

}
else if(forceGenerate)
{
var line = customVariable.Scope.ToString().ToLowerInvariant() + " " +
StringHelper.Modifiers(Static: customVariable.IsShared, Type: memberType, Name: customVariable.Name) + ";";

codeBlock.Line(line);
}
}
}
}
Expand Down

0 comments on commit f824632

Please sign in to comment.