[Issue 21501] New: [REG 2.089.1] undefined identifier in package when using mixin and cyclic imports
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Wed Dec 23 12:42:10 UTC 2020
https://issues.dlang.org/show_bug.cgi?id=21501
Issue ID: 21501
Summary: [REG 2.089.1] undefined identifier in package when
using mixin and cyclic imports
Product: D
Version: D2
Hardware: x86_64
OS: Linux
Status: NEW
Severity: regression
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: tim.dlang at t-online.de
//////////////// test/a.d ////////////////
module test.a;
import test.b;
import test.c;
alias Identity(T) = T;
struct A
{
Identity!(mixin(q{test.c.C})) data;
}
//////////////// test/b.d ////////////////
module test.b;
import test.a;
struct B
{
A data;
}
//////////////// test/c.d ////////////////
module test.c;
alias C = int;
//////////////////////////////////////////
Running dmd -c test/a.d results in the following error:
test/a.d-mixin-10(10): Error: undefined identifier c in package test, perhaps
add static import test.c;
Running dmd -c test/b.d test/a.d test/c.d instead does not result in an error.
The order of the files is important, because dmd -c test/a.d test/b.d test/c.d
does result in the error.
The error happens with dmd v2.089.1, while it works normally with dmd v2.089.0.
It looks like https://github.com/dlang/dmd/pull/10584 introduced it.
--
More information about the Digitalmars-d-bugs
mailing list