Skip to content

fix: handle no-argument resetAll calls in C# - #26

Merged
panayotisk merged 1 commit into
mainfrom
fix/csharp-resetall-empty-arguments
Nov 12, 2026
Merged

panayotisk merged 1 commit into
mainfrom
fix/csharp-resetall-empty-arguments

Conversation

@panayotisk

Copy link
Copy Markdown
Collaborator

Calling resetAll() without arguments currently passes a null list to the C# built-in and throws a NullReferenceException, surfaced as a RuntimeException. Initialize the visitor's argument list with Array.Empty<object>() so the call restores all variable defaults successfully.

Add regression coverage for resetting global, board, and component variables with modified current values, and for calling resetAll() on an empty project.

Validation:

  • Both regression tests reproduced the exception before the fix.
  • Generated ANTLR sources and built the C# solution in Release with .NET 6 (0 errors; existing warnings remain).
  • All 148 C# tests pass, including existing reset exclusions and other no-argument built-ins.

@Zanzavar Zanzavar left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed at ab0a3e0. The empty argument list matches TypeScript and C++ behavior. All 148 C# tests and 238 TypeScript tests passed, along with additional edge-case checks. No actionable findings.

@panayotisk
panayotisk merged commit acd53fb into main Nov 12, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants