Bug 1248 – Weird error "... of type TOK146" on recursive type definition
Status
RESOLVED
Resolution
WORKSFORME
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
All
Creation time
2007-05-26T09:38:00Z
Last change time
2014-02-16T15:23:12Z
Keywords
diagnostic
Assigned to
bugzilla
Creator
bruno.do.medeiros+deebugz
Comments
Comment #0 by bruno.do.medeiros+deebugz — 2007-05-26T09:38:02Z
This code:
----- ----
void func(functype param) {
param(null);
}
alias typeof(&func) functype;
----
breaks with:
"main.d(3): Error: function expected before (), not param of type TOK14"
I'm not sure if the code above is valid or not, but at least the error message is broken.
Comment #1 by bruno.do.medeiros+deebugz — 2007-05-26T09:47:33Z
Here's a minor variant:
----
functype func(int param) {
return null;
}
alias typeof(&func) functype;
----
"main.d(3): Error: cannot implicitly convert expression (null) of type void* to TOK146"
Definitely a bug.