www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 12202] New: SortedRange + alias this + foreach => Segmentation fault

https://d.puremagic.com/issues/show_bug.cgi?id=12202

           Summary: SortedRange + alias this + foreach => Segmentation
                    fault
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: tobias pankrath.net



PST ---
--
 struct S(T)
  4 {
  5    import std.range;
  6    
  7    T[] data;
  8    
  9    auto sortedRange() { return assumeSorted(data); }
 10    alias sortedRange this; 
 11    
 12 }  
 13 unittest
 14 {
 15    auto a1 = S!int([1, 3,3,3, 4, 4]);
 16    foreach(i, e; a1)
 17    {  
 18    
 19    }  
 20 }                       
--
$ dmd -unittest -main test.d
zsh: segmentation fault (core dumped)  dmd -unittest -main test.d

Both in 2.064 and ~master.

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 19 2014