How is this code supposed to work?
Neia Neutuladh
neia at ikeran.org
Sat Jan 26 00:24:30 UTC 2019
On Fri, 25 Jan 2019 19:14:51 -0500, Steven Schveighoffer wrote:
> Interestingly, It's not possible to do the second form, so it's a bit
> curious why we don't just drop the requirements for nested
> parentheses...
The error messages there are really hideous, too:
template Just(alias s) { alias Just = s; }
alias f = (Just!Just)!int;
scratch.d(16): Error: basic type expected, not (
scratch.d(16): Error: function declaration without return type. (Note that
constructors are always named this)
scratch.d(16): Error: semicolon expected to close alias declaration
scratch.d(16): Error: found ; when expecting . following int
scratch.d(17): Error: found } when expecting identifier following int.
scratch.d(18): Error: found End of File when expecting ; following
statement
scratch.d(18): Error: found End of File when expecting } following
compound statement
So I guess this is just to make people less confused about order of
operations, since it would be unexpectedly right-associative in a language
where most things are left-associative?
More information about the Digitalmars-d-learn
mailing list