Bug 9659 – Aliases are broken by latest git HEAD

Status
RESOLVED
Resolution
INVALID
Severity
regression
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-03-06T22:15:00Z
Last change time
2013-03-06T22:51:15Z
Assigned to
nobody
Creator
hsteoh

Comments

Comment #0 by hsteoh — 2013-03-06T22:15:59Z
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;
Comment #2 by bugzilla — 2013-03-06T22:51:15Z
Marked as invalid. The rationale is presented here: http://d.puremagic.com/issues/show_bug.cgi?id=8220