Fix #1501: Generate WhenStateIs/WillSetStateTo correctly in ToCSharpCode - #1502
Merged
Merged
Conversation
Collaborator
|
I |
Collaborator
|
@Bafyn public override string GetCSharpCodeArguments()
{
return
$"new {Name}" +
$"(" +
$"{MatchBehaviour.GetFullyQualifiedEnumValue()}, " +
$"new AnyOf<string, StringPattern>[] {{ {MappingConverterUtils.ToCSharpCodeArguments(_patterns)} }}, " +
$"{CSharpFormatter.ToCSharpBooleanLiteral(IgnoreCase)}, " +
$"{MatchOperator.GetFullyQualifiedEnumValue()}" +
$")";
} |
Contributor
Author
|
@StefH I realized you did when I noticed you assigned the issue to yourself 🙃 UPD: yes, checking |
StefH
requested changes
Aug 17, 2026
StefH
requested changes
Aug 18, 2026
Contributor
Author
|
FYI @StefH the other matchers had the same issues. Fixed them in scope of the latest update |
Bafyn
force-pushed
the
fix/mappings-code-scenario-state
branch
from
August 18, 2026 14:53
c804ec4 to
5cc3d42
Compare
Bafyn
force-pushed
the
fix/mappings-code-scenario-state
branch
from
August 18, 2026 15:16
5cc3d42 to
e9deb0b
Compare
StefH
requested changes
Aug 18, 2026
Collaborator
|
Added comment. And if you have fixed an issue, you can "resolve conversation" here in the github. |
Bafyn
marked this pull request as draft
August 18, 2026 20:28
Bafyn
marked this pull request as ready for review
August 18, 2026 20:28
StefH
approved these changes
Aug 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
MappingConverter.ToCSharpCodegenerated broken code for stateful (Scenario) mappings: it emitted.WhenStateIs(NextState, TimesInSameState), which has no matching overload (does not compile), usedNextStateunderWhenStateIs, and never emitted the actualExecutionConditionState.References
Fixes #1501
Submitter checklist
Tests
MappingConverterTests.ToCSharpCodecases;MappingBuilderTests.ToCSharpCodeverified snapshots.