www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 2084] New: operator ?: does not compute the tightest type

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2084

           Summary: operator ?: does not compute the tightest type
           Product: D
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: andrei metalanguage.com


Consider:

#!/home/andrei/bin/rdmd -w
import std.stdio;

class Base {}

class D1 : Base {}
class D2 : Base {}

void main(string[] args)
{
    auto b = args ? new D1 : new D2;
}

This program should compile and run, deducing Base as b's type. It fails to
compile as written. Replacing "auto" with "Base" still doesn't help.


-- 
May 08 2008
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2084


bugzilla digitalmars.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED




------- Comment #1 from bugzilla digitalmars.com  2008-05-22 05:05 -------
Fixed dmd 1.030 and 2.014


-- 
May 22 2008