[Issue 15925] New: [REG 2.071] Import declaration from mixin templates are ignored
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Thu Apr 14 16:03:24 PDT 2016
https://issues.dlang.org/show_bug.cgi?id=15925
Issue ID: 15925
Summary: [REG 2.071] Import declaration from mixin templates
are ignored
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
With the new import rules:
```
module A;
public mixin template AddImports ()
{
protected import core.thread;
Thread th;
}
```
```
module B;
import A;
public class Foo
{
mixin AddImports;
Thread t;
}
```
b.d(9): Error: undefined identifier 'Thread'
It used to compile in 2.070.
Since its not even a deprecation, and the specs mention it's possible ("The
declarations in a mixin are ‘imported’ into the surrounding scope."), it looks
like a regression.
--
More information about the Digitalmars-d-bugs
mailing list