After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 529680 - Postconditions for normal methods
Postconditions for normal methods
Status: RESOLVED FIXED
Product: vala
Classification: Core
Component: Methods
0.3.x
Other All
: Normal minor
: ---
Assigned To: Jürg Billeter
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2008-04-24 08:59 UTC by Philip Van Hoof
Modified: 2009-06-04 12:16 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Philip Van Hoof 2008-04-24 08:59:29 UTC
When doing this the ensures() is ignored:

public class Test {
   public int foo (int bar) ensures (result > 100) {
     return bar + 100;
   }
}
Comment 1 Jürg Billeter 2008-04-25 12:16:03 UTC
Confirming.
Comment 2 Frederik Zipp 2008-12-10 17:32:41 UTC
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
Comment 3 Jürg Billeter 2009-06-04 12:16:45 UTC
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.