Summary: wrong error: undefined identifier
           Product: D
           Version: D1
          Platform: x86
        OS/Version: Linux
            Status: NEW
          Severity: regression
          Priority: P2
         Component: DMD

--- Comment #0 from Leandro Lucarella <> 
2012-01-26 08:50:37 PST ---
Test case:

import m2;
interface I {}
class C : I { mixin M!(I); }

import m1;
template M (T)
    public void f()
        bug(1); // line 6

template bug(T)
    void bug(T t) {}

$ dmd -c m.d
m2.d(6): Error: undefined identifier bug
m2.d(6): Error: function expected before (), not __error of type _error_

Aside from the second spurious error, "bug" symbol should be perfectly defined.

Moving any template function to another module fixes the problem. Using a
selective import (import m1 : bug;) also fails. Using the full name of the
symbol (m1.bug(1); using static import m1; or without static) produces this
error instead:

m2.d(6): Error: undefined identifier m1, did you mean module m?
m2.d(6): Error: function expected before (), not __error of type _error_

Adding an alias to m2.d like this: alias m1.bug bug; fixes the problem. So it
looks like the symbol is hidden to the template.

A git bisect show this commit as the one introducing the regression:
merge D2 pull 591 (93a643aba6f62db1b7658c2bfb51f9d0b576c337)

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to