Thread overview
[Issue 9659] New: Aliases are broken by latest git HEAD
Mar 07, 2013
Kenji Hara
Mar 07, 2013
Walter Bright
March 07, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=9659

           Summary: Aliases are broken by latest git HEAD
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: regression
          Priority: P2
         Component: DMD
        AssignedTo: nobody@puremagic.com
        ReportedBy: hsteoh@quickfur.ath.cx


--- Comment #0 from hsteoh@quickfur.ath.cx 2013-03-06 22:15:59 PST ---
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.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
March 07, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=9659



--- Comment #1 from Kenji Hara <k.hara.pg@gmail.com> 2013-03-06 22:46:20 PST ---
(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;

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
March 07, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=9659


Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |bugzilla@digitalmars.com
         Resolution|                            |INVALID


--- Comment #2 from Walter Bright <bugzilla@digitalmars.com> 2013-03-06 22:51:15 PST ---
Marked as invalid. The rationale is presented here:

http://d.puremagic.com/issues/show_bug.cgi?id=8220

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------