Code:
import std.algorithm;
void main() {
alias typeof(splitter(string,string)) SrcType;
}
Compiler output:
test.d(4): Error: string is not an expression
test.d(4): Error: string is not an expression
test.d(4): Error: string is not an expression
test.d(4): Error: string is not an expression
This is caused by commit 3644943a299b5e50157c8b2f8cfec609fed5fd68; checking out the previous commit a73c83becfb9ba0b45af44147b6d7c0edad0978a and rebuilding DMD fixes the problem.
Comment #1 by k.hara.pg — 2013-03-06T22:46:20Z
(In reply to comment #0)
> Code:
>
> import std.algorithm;
>
> void main() {
> alias typeof(splitter(string,string)) SrcType;
> }
>
> Compiler output:
> test.d(4): Error: string is not an expression
> test.d(4): Error: string is not an expression
> test.d(4): Error: string is not an expression
> test.d(4): Error: string is not an expression
>
> This is caused by commit 3644943a299b5e50157c8b2f8cfec609fed5fd68; checking out
> the previous commit a73c83becfb9ba0b45af44147b6d7c0edad0978a and rebuilding DMD
> fixes the problem.
That is intended behavior. By fixing issue 8220 (commit 3644943a29), such an invalid type occurence in expression context is correctly rejected.
In this case, it should be rewritten to:
alias typeof(splitter(string.init, string.init)) SrcType;