GNOME Bugzilla – Bug 652781
nullable enum does not work properly
Last modified: 2011-06-17 19:14:39 UTC
When enum variable is marked as nullable by "?", it stops working. Here is a small piece of code demonstrating the problem: enum MyEnum { ONE, TWO } int main(string[] args) { MyEnum a = MyEnum.ONE; if (a == MyEnum.ONE) stdout.printf("a is one\n"); MyEnum? b = MyEnum.ONE; if (b == MyEnum.ONE) stdout.printf("b is one\n"); return 0; } It should print: a is one b is one but it prints only the first line instead. If "MyEnum? b" is replaced by "MyEnum b" everything works.
commit 93916205264b4e90842f57675fb455c69a94fa8d Author: Luca Bruno <lucabru@src.gnome.org> Date: Fri Jun 17 15:38:00 2011 +0200 codegen: Fix equality expression with nullable enum values Fixes bug 652781. This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.