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

EnC: Changing the type of an expression around an active foreach statement should be a rude edit #3627

Closed
wschae opened this issue Jun 22, 2015 · 4 comments

Comments

@wschae
Copy link
Contributor

wschae commented Jun 22, 2015

  1. C# App:
   class Program
   {
       static void Main(string[] args)
       {
           var b = new int[] { 1, 2, 3 };
           foreach (var a in b)
           {
               Console.WriteLine(a); // Add a breakpoint here
           }
       }
   }
  1. F5 to stop at the breakpoint
  2. Update "int[]" to "double[]" of type of b
  3. Continue

Expected: Rude edit saying "cannot edit foreach around an active statement"

Actual: NullReferenceException when stepping into the next iteration of the loop

6

@wschae
Copy link
Contributor Author

wschae commented Jun 22, 2015

Ported from internal bug 1009555

@wschae
Copy link
Contributor Author

wschae commented Jun 22, 2015

Check also 781309 - EnC: Report warning (that local value will be dropped) if local type has changed

@wschae wschae removed this from the 1.1 milestone Aug 18, 2015
@wschae wschae removed their assignment Aug 24, 2015
@ManishJayaswal ManishJayaswal added this to the 1.1 milestone Aug 25, 2015
@tmat tmat modified the milestones: 1.2, 1.1 Sep 17, 2015
@amcasey amcasey unassigned tmat Nov 2, 2015
@amcasey
Copy link
Member

amcasey commented Nov 2, 2015

Assigning to @drognanar (fyi @tmat).

@ManishJayaswal ManishJayaswal modified the milestones: 1.2, 1.3 Jan 27, 2016
@ManishJayaswal ManishJayaswal modified the milestones: 1.3, 2.0 (RC) May 6, 2016
@ManishJayaswal ManishJayaswal modified the milestones: 2.0 (RC), 2.1 Oct 14, 2016
@tmat
Copy link
Member

tmat commented Sep 28, 2024

Fixed by #74526

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants