digitalmars.D.bugs - [Issue 11521] New: Switch using same name variable leads to Access Violation
- d-bugmail puremagic.com (32/32) Nov 15 2013 https://d.puremagic.com/issues/show_bug.cgi?id=11521
https://d.puremagic.com/issues/show_bug.cgi?id=11521 Summary: Switch using same name variable leads to Access Violation Product: D Version: D2 Platform: All OS/Version: All Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: nobody puremagic.com ReportedBy: temtaime gmail.com import std.algorithm; void main() { auto arr = [ 1, 3, 4, 2, 3, 8, 2 ]; int dummy; switch(0) { case 1: auto f = (int a, int b) { return a - dummy < b; }; sort!f(arr); break; default: auto f = (int a, int b) { return a - dummy < b; }; sort!f(arr); } } This code causes AV, renaming second f to f2 runs successful. -- Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Nov 15 2013