[Issue 16105] New: `is` fails for init value of struct with float

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Tue May 31 02:46:44 PDT 2016


          Issue ID: 16105
           Summary: `is` fails for init value of struct with float
           Product: D
           Version: D2
          Hardware: x86_64
               URL: https://forum.dlang.org/post/jzgwikubjfmlcdgpierj@foru
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: schuetzm at gmx.net

The following test case only prints "B: works", although the first comparison
should succeed, too:

import std.stdio;

struct Foo
    int x;
    float f;

void main()
    Foo foo;
    if(foo is Foo.init) "A: doesn't work".writeln;
    foo = Foo();
    if(foo is Foo.init) "B: works".writeln;

Found by ArturG:


More information about the Digitalmars-d-bugs mailing list