Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert explicitely omitted ByRef arguments into temporary variables #1121

Conversation

TymurGubayev
Copy link
Contributor

Problem

#1107: OmittedArgumentSyntax isn't converted into temporary variable for ByRef parameters causing error CS7036

Solution

  • Only a minor change. I decided to have redundand call to processedParameters.Add(parameterSymbol.Name); in these cases (by removing the just added name), to keep the number of ifs (and avoid nesting another one within). There are alternatives, but IMHO the tiny performance impact is ok.
  • At least one test covering the code changed

@TymurGubayev TymurGubayev changed the title Fix/explicitely omitted arguments/1 Fix explicitely omitted arguments Jul 22, 2024
@TymurGubayev TymurGubayev changed the title Fix explicitely omitted arguments Convert explicitely omitted ByRef arguments into temporary variables Jul 22, 2024
Hopefully this stops someone tweaking the logic and forgetting to remove the parameter - there's already enough mutation of state going on with the forceNamedParameters aspect
…tedArguments/1

# Conflicts:
#	Tests/CSharp/MemberTests/MemberTests.cs
@GrahamTheCoder GrahamTheCoder force-pushed the fix/ExplicitelyOmittedArguments/1 branch from 381f396 to d85f6b3 Compare July 22, 2024 22:48
@GrahamTheCoder GrahamTheCoder merged commit b8c386d into icsharpcode:master Jul 22, 2024
1 check passed
@TymurGubayev TymurGubayev deleted the fix/ExplicitelyOmittedArguments/1 branch July 23, 2024 08:46
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