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

Rename symbol does not work when applied on conversion operator return type #77082

Open
just-ero opened this issue Feb 6, 2025 · 1 comment
Labels
Area-Compilers untriaged Issues and PRs which have not yet been triaged by a lead

Comments

@just-ero
Copy link

just-ero commented Feb 6, 2025

Full issue information + repro project:
https://github.com/just-ero/roslyn-issues-repros/tree/main/4.14.0/001_RenameSymbol_ConversionOperator

Version

Roslyn: 4.14.0-1.25074.7

Steps to Reproduce

  1. Add the following code wherever syntactically applicable:
    class C;
    
    class Repro1
    {
        public static explicit operator Repro1(C _)
        {
            return null;
        }
    }
    
    class Repro2<T>
    {
        public static explicit operator Repro2<T>(T _)
        {
            return null;
        }
    }
  2. Apply the Rename symbol action on the return type in the conversion operator declarations.

Expected Behavior

The symbol is renamed everywhere.

Actual Behavior

Repro1: Only the name in the operator declaration is renamed.
Repro2: Nothing is renamed.

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Compilers untriaged Issues and PRs which have not yet been triaged by a lead labels Feb 6, 2025
@just-ero
Copy link
Author

just-ero commented Feb 6, 2025

Note: Renaming works correctly (even the return type of the operator is renamed) when applied anywhere else in the sample code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Compilers untriaged Issues and PRs which have not yet been triaged by a lead
Projects
None yet
Development

No branches or pull requests

1 participant