Skip to content

Conversation

EraYaN
Copy link
Contributor

@EraYaN EraYaN commented Aug 5, 2025

This prevents name collisions for the targetRef variables

Fix name collision, reuse context within switch statement

Description

This should stop any name collisions. I'm not sure why in the tests the sourceNames are now less unique in some spots, but it should all compile just fine.

Fixes #1904

Checklist

  • The existing code style is followed
  • The commit message follows our guidelines
  • Performed a self-review of my code
  • Hard-to-understand areas of my code are commented
  • The documentation is updated (as applicable)
  • Unit tests are added/updated
  • Integration tests are added/updated (as applicable, especially if feature/bug depends on roslyn or framework version in use)

@EraYaN EraYaN changed the title Fix name collision, reuse context within switch statement fix: Name collision, reuse context within switch statement Aug 5, 2025
@EraYaN EraYaN force-pushed the reuse-context-for-switch-statements branch 3 times, most recently from 63f0b80 to 1f24ddb Compare August 5, 2025 12:15
This prevents name collisions for the targetRef variables
@EraYaN EraYaN force-pushed the reuse-context-for-switch-statements branch from 1f24ddb to 31490c1 Compare August 5, 2025 12:23
Copy link
Contributor

@latonz latonz left a comment

Choose a reason for hiding this comment

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

Thank you for this contribution 🥳

@latonz latonz added the bug Something isn't working label Aug 6, 2025
@latonz latonz merged commit 1c11cad into riok:main Aug 6, 2025
19 of 20 checks passed
@EraYaN EraYaN deleted the reuse-context-for-switch-statements branch August 6, 2025 12:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ctx.NameBuilder.New does not return unique names when multiple derived types are in one mapping method

2 participants