GNOME Bugzilla – Bug 529680
Postconditions for normal methods
Last modified: 2009-06-04 12:16:45 UTC
When doing this the ensures() is ignored: public class Test { public int foo (int bar) ensures (result > 100) { return bar + 100; } }
Confirming.
It is not only ignored, but also makes the Vala compiler crash: ------------- error: `Test.foo' already contains a definition for `result' (valac:14012): GLib-GObject-WARNING **: invalid cast from `ValaMethod' to `ValaBlock' Segmentation fault
commit 9a017f8975900a736b231a3b2dee8e0aca8c383f Author: Jürg Billeter <j@bitron.ch> Date: Thu Jun 4 14:14:09 2009 +0200 Support postconditions in normal methods Fixes bug 529680.