[Issue 1479] mixin error across two module

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Aug 15 10:08:46 UTC 2019


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

RazvanN <razvan.nitu1305 at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |razvan.nitu1305 at gmail.com
         Resolution|---                         |INVALID

--- Comment #2 from RazvanN <razvan.nitu1305 at gmail.com> ---
This bug is invalid.

When you instantiate `S2!(tpl) v;` in main (test.d), the symbol tpl is visible,
so there's no problem. Now when S2 needs to be instantiated you instantiate S1
with the alias symbol t which points to tpl. This is fine also, but when you
instantiate S1, you mixin the code that is contained by the tpl template which
is 
`alias S2!(tpl) tt;`, so your S1 becomes:

struct S1
{
    alias S2!tpl tt;
}

but in the file test1.d  there is no tpl symbol, therefore you end up with the
correct issued error. To fix this you just have to import test.d.

Closing as invalid.

--


More information about the Digitalmars-d-bugs mailing list