www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 15925] New: [REG 2.071] Import declaration from mixin


          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 puremagic.com
          Reporter: mathias.lang 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
like a regression.

Apr 14 2016