Bug 36 – Error message generated by odd enum forward-reference (?) alias bug is cryptic
Status
RESOLVED
Resolution
FIXED
Severity
minor
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
Windows
Creation time
2006-03-11T11:41:00Z
Last change time
2014-02-15T02:10:01Z
Keywords
diagnostic, rejects-valid
Assigned to
bugzilla
Creator
jarrett.billingsley
Comments
Comment #0 by jarrett.billingsley — 2006-03-11T11:41:03Z
This is an obscure one.
This code compiles, as expected:
enum E
{
One,
Two,
Three
}
class A
{
alias void delegate(E) EDG;
static void fork(EDG dg)
{
dg(E.One);
}
}
But move the alias declaration after the function:
class A
{
static void fork(EDG dg)
{
dg(E.One);
}
alias void delegate(E) EDG;
}
And you get the cryptic error:
dtest.d(18): cannot implicitly convert expression (0) of type E to E
Maybe this has something to do with forward referencing?