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 does not update usages in complex patterns. #9079

Closed
CyrusNajmabadi opened this issue Feb 23, 2016 · 2 comments
Closed

Rename does not update usages in complex patterns. #9079

CyrusNajmabadi opened this issue Feb 23, 2016 · 2 comments
Assignees
Labels
Area-Compilers Area-IDE New Language Feature - Pattern Matching Pattern Matching Resolution-Fixed The bug has been fixed and/or the requested behavior has been implemented Test Test failures in roslyn-CI

Comments

@CyrusNajmabadi
Copy link
Member

    public class Expression { }
    public class Constant : Expression
    {
        public readonly int Value;
        public Constant(int Value)
        {
            this.Value = Value;
        }
    }
    public class Plus : Expression
    {
        public readonly Expression Left, Right;     // rename Left here.
        public Plus(Expression Left, Expression Right)
        {
            this.Left = Left;
            this.Right = Right;
        }
    }
    public class X
    {
        public static void Main()
        {
            Expression expr = new Plus(new Plus(new Constant(1), new Plus(new Constant(2), new Constant(3))), new Constant(6));

            if (expr is Plus { Left is Plus p,Right is Constant c })
            {
            }

Renaming Plus.Left does not update reference in the complex pattern.

@jaredpar
Copy link
Member

jaredpar commented Mar 2, 2016

Reopen pending unit tests.

@jaredpar jaredpar reopened this Mar 2, 2016
@jaredpar jaredpar removed the Resolution-Fixed The bug has been fixed and/or the requested behavior has been implemented label Mar 2, 2016
gafter added a commit to gafter/roslyn that referenced this issue Mar 3, 2016
@gafter gafter added Area-IDE 4 - In Review A fix for the issue is submitted for review. Test Test failures in roslyn-CI and removed Bug labels Mar 3, 2016
@gafter
Copy link
Member

gafter commented Mar 3, 2016

Fixed in features/patterns via #9440.

@gafter gafter closed this as completed Mar 3, 2016
@gafter gafter added Resolution-Fixed The bug has been fixed and/or the requested behavior has been implemented and removed 4 - In Review A fix for the issue is submitted for review. labels Mar 3, 2016
@gafter gafter assigned jaredpar and unassigned gafter Mar 3, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Compilers Area-IDE New Language Feature - Pattern Matching Pattern Matching Resolution-Fixed The bug has been fixed and/or the requested behavior has been implemented Test Test failures in roslyn-CI
Projects
None yet
Development

No branches or pull requests

4 participants