typeof and my crummy code...
Ellery Newcomer
ellery-newcomer at utulsa.edu
Fri Nov 6 09:02:29 PST 2009
Another question: given
import std.stdio;
void main()
{
int i( /*char*/ ){return 1;}
writeln(typeof(i).stringof);
}
This gives
(int())()
and with the char uncommented it errors
* typeof doesn't evaluate the expression, according to the spec.
* then why does it matter if the function has its parameters applied above?
* for a function sans params, there would be a semantic ambiguity (in D1
land, at least) in typeof(i) (params applied, or no?)
* and for the case above, why the heck are we mixing expression and type
in the string result?
More information about the Digitalmars-d-learn
mailing list