Thread overview | |||||
---|---|---|---|---|---|
|
April 21, 2014 [Issue 10413] .init incorrectly accepts any expression | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=10413 Andrej Mitrovic <andrej.mitrovich@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |andrej.mitrovich@gmail.com --- Comment #4 from Andrej Mitrovic <andrej.mitrovich@gmail.com> --- According to Walter it's ok if a UDT defines its own .init, which would make value.init valid: https://issues.dlang.org/show_bug.cgi?id=7066 I don't agree with him though, especially since the whole argument against allowing user-defined default ctors is the compile-time known .init property. -- |
June 09, 2015 [Issue 10413] .init incorrectly accepts any expression | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=10413 Andrei Alexandrescu <andrei@erdani.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version|D1 & D2 |D2 -- |
November 03, 2019 [Issue 10413] .init incorrectly accepts any expression | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=10413 Nicholas Wilson <iamthewilsonator@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED CC| |iamthewilsonator@hotmail.co | |m Resolution|--- |INVALID --- Comment #5 from Nicholas Wilson <iamthewilsonator@hotmail.com> --- int foo() { return 1; } static assert(foo.init == 0); is a case of optional parentheses, as char foo() { return 1; } static assert(foo.init == 255); passes, but int foo(int) { return 1; } static assert(foo.init == 0); fails with onlineapp.d(3): Error: function onlineapp.foo(int) is not callable using argument types () onlineapp.d(3): missing argument for parameter #1: int onlineapp.d(3): while evaluating: static assert((__error).init == 0) closing as invalid -- |
Copyright © 1999-2021 by the D Language Foundation