Thread overview
[Issue 21351] When struct A is imported inside struct B, with(B) gets passed to A() constructor.
Oct 30, 2020
Mario Kroeplin
Oct 31, 2020
Boris Carvajal
Nov 01, 2020
Boris Carvajal
October 30, 2020
https://issues.dlang.org/show_bug.cgi?id=21351

Mario Kroeplin <kroeplin.d@googlemail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |industry
                 CC|                            |kroeplin.d@googlemail.com

--
October 31, 2020
https://issues.dlang.org/show_bug.cgi?id=21351

Boris Carvajal <boris2.9@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |boris2.9@gmail.com

--- Comment #1 from Boris Carvajal <boris2.9@gmail.com> ---
This code should error about 'A' not being found in 'B' because imports are private by default.

For example:

    void main() { B().A(0); } // prints:  'Error: no property A for type b.B'

or using a type instead of a symbol in 'with' statement:

    void main() { with (B) A(0); } // same error


You can make it work by changing:

    struct B { import a : A; }
to:
    struct B { public import a : A; }


I will try to fix the error but I'm not sure whether to change the bug subject or file a new one.

--
November 01, 2020
https://issues.dlang.org/show_bug.cgi?id=21351

Boris Carvajal <boris2.9@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |MOVED

--- Comment #2 from Boris Carvajal <boris2.9@gmail.com> ---
I'm closing this in favor of issue 21353.

--