[Issue 11270] New: [REG 2.064] Initialization of struct in constructor

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Oct 15 02:25:28 PDT 2013


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

           Summary: [REG 2.064] Initialization of struct in constructor
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: regression
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: code at benjamin-thaut.de


--- Comment #0 from Benjamin Thaut <code at benjamin-thaut.de> 2013-10-15 02:25:27 PDT ---
The following code used to work dmd 2.064 beta 1 and all versions before that.
It just broke on the latest version of the 2.064 branch on git. 

repro.d(13): Error: cannot implicitly convert expression (f) of type float to
netvar!float

Although I'm not really sure if this is a bug or if the code is invalid and
just used to work because of other bugs.


Repro case:

struct netvar(T) {
    T value;
    alias value this;

    void opAssign(T newVal){
        value = newVal;
    }    
}

void main(string[] args)
{
  float f = 2.0f;
  netvar!float f2 = f;
}

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


More information about the Digitalmars-d-bugs mailing list