[Issue 20023] New: Separate compilation breaks dip1000 / dip1008 @safety

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Jul 3 17:02:14 UTC 2019


https://issues.dlang.org/show_bug.cgi?id=20023

          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 at puremagic.com
          Reporter: john.loughran.colvin at gmail.com

// test.d
import test2;
void main()
{
    threw!()();
}

// test2.d
auto threw()() @safe
{
    try
        throw new Exception("Hello");
    catch (Exception e)
        return e;
    assert(0);
}

# dmd test.d -dip1000 -dip1008 -dip25 -c
# dmd test2.d -dip1000 -dip1008 -dip25 -c
# dmd test.obj test2.obj

Happy to compile despite the bug

# dmd test.d test2.d -dip1000 -dip1008 -dip25
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

--


More information about the Digitalmars-d-bugs mailing list