www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 20023] New: Separate compilation breaks dip1000 / dip1008


          Issue ID: 20023
           Summary: Separate compilation breaks dip1000 / dip1008  safety
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: john.loughran.colvin gmail.com

// test.d
import test2;
void main()

// test2.d
auto threw()()  safe
        throw new Exception("Hello");
    catch (Exception e)
        return e;

Happy to compile despite the bug

test2.d(6): Error: scope variable e may not be returned
test.d(5): Error: template instance `test2.threw!()` error instantiating

Catches the problem correctly

Jul 03 2019