May 17, 2014 [Issue 10326] Disallow 'invariant' for immutable, allow class/struct invariants without (), and later disallow usage of () | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=10326 --- Comment #12 from Temtaime <temtaime@gmail.com> --- I think we should simply show deprecate message for invariant() to help updating user's code and remove it in future. It's best way imo. -- |
May 17, 2014 [Issue 10326] Disallow 'invariant' for immutable, allow class/struct invariants without (), and later disallow usage of () | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=10326 --- Comment #13 from bearophile_hugs@eml.cc --- (In reply to Kenji Hara from comment #9) > Instead of that, how about to accept both invariant(){...} and > unittest(){...} ? I prefer to disallow () in both. -- |
May 17, 2014 [Issue 10326] Disallow 'invariant' for immutable, allow class/struct invariants without (), and later disallow usage of () | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=10326 yebblies <yebblies@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |yebblies@gmail.com --- Comment #14 from yebblies <yebblies@gmail.com> --- (In reply to Kenji Hara from comment #9) > > Instead of that, how about to accept both invariant(){...} and > unittest(){...} ? I think that's a good idea. I see very little benefit to enforcing one syntax over the other. There doesn't seem much potential for confusion in having two syntaxes if both unittest and invariant work the same way. -- |
May 18, 2014 [Issue 10326] Disallow 'invariant' for immutable, allow class/struct invariants without (), and later disallow usage of () | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=10326 briancschott@gmail.com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |briancschott@gmail.com See Also| |https://issues.dlang.org/sh | |ow_bug.cgi?id=5038 --- Comment #15 from briancschott@gmail.com --- (In reply to bearophile_hugs from comment #13) > (In reply to Kenji Hara from comment #9) > > > Instead of that, how about to accept both invariant(){...} and > > unittest(){...} ? > > I prefer to disallow () in both. I vote for this also. The parenthesis serve no purpose. The compiler should accept () with a deprecation message and then we should get rid of them. Quoting from bug 5038: "Well, this is a very strange situation. invariant without parentheses is LEGAL IN D1! When converting D1 code to D2, you get this nonsense deprecation message asking you to use immutable instead. We have existing production code which uses invariant without parentheses! We should make it legal again. This would be an undeprecation, which AFAIK has never happened before in D." -- |
December 17, 2022 [Issue 10326] Disallow 'invariant' for immutable, allow class/struct invariants without (), and later disallow usage of () | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=10326 Iain Buclaw <ibuclaw@gdcproject.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Priority|P2 |P4 -- |
Copyright © 1999-2021 by the D Language Foundation