digitalmars.D.bugs - [Issue 16105] New: `is` fails for init value of struct with float
- via Digitalmars-d-bugs (33/33) May 31 2016 https://issues.dlang.org/show_bug.cgi?id=16105
https://issues.dlang.org/show_bug.cgi?id=16105 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 m.dlang.org OS: Linux Status: NEW Severity: normal Priority: P1 Component: dmd Assignee: nobody puremagic.com Reporter: schuetzm 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: https://forum.dlang.org/post/jzgwikubjfmlcdgpierj forum.dlang.org --
May 31 2016