[Issue 15966] New: [REG 2.071] {public,protected} imports in base class ignored on symbol lookup

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Thu Apr 28 10:18:05 PDT 2016


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

          Issue ID: 15966
           Summary: [REG 2.071] {public,protected} imports in base class
                    ignored on symbol lookup
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: regression
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: mathias.lang at sociomantic.com
                CC: public at dicebot.lv

Quite similar to https://issues.dlang.org/show_bug.cgi?id=15925

```
module definitions;

import core.exception;

public class RangeAssertError : RangeError
{
    @safe pure nothrow this( string msg, string file = __FILE__,
                             size_t line = __LINE__, Throwable next = null )
    {
        super( msg, file, line, next );
    }

    // Since we import it as protected, subclasses should be able to override
    // this function without import.
    protected import core.exception;

    public AssertError getAssert ();
}
```

```
module usage;

import definitions;

public class RangeAssertErrorImpl : RangeAssertError
{
    @safe pure nothrow this( string msg, string file = __FILE__,
                             size_t line = __LINE__, Throwable next = null )
    {
        super( file, line, next );
    }

    public override AssertError getAssert () { return null; }
}

```

Works in DMD 2.070, not in 2.071. Tested with public import as well.

--


More information about the Digitalmars-d-bugs mailing list