April 28, 2016 [Issue 15966] New: [REG 2.071] {public,protected} imports in base class ignored on symbol lookup | ||||
|---|---|---|---|---|
| ||||
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@puremagic.com Reporter: mathias.lang@sociomantic.com CC: public@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. -- | ||||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply