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 599892 - Static properties are not compiled properly
Static properties are not compiled properly
Status: RESOLVED FIXED
Product: vala
Classification: Core
Component: general
0.7.x
Other Linux
: Normal normal
: ---
Assigned To: Vala maintainers
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2009-10-28 11:05 UTC by Jan Stępień
Modified: 2009-10-28 14:24 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Jan Stępień 2009-10-28 11:05:41 UTC
Static properties are not compiled properly and are not present in the output C code. Take a look at line 64 in the Test.c below. There should be a second argument, i.e.

  test_nop (self, test_get_x ());

instead of

  test_nop (self);

$ valac --version
Vala 0.7.7
$ cat Test.vala 
  class Test {
    public static int x {get; set;}
    Test(int val) { x = val; nop(x); }
    private void nop(int a) { }
  }
$ valac -C Test.vala 

** (valac:15280): CRITICAL **: vala_ccode_member_access_construct_pointer: assertion `container != NULL' failed

** (valac:15280): CRITICAL **: vala_ccode_member_access_construct_pointer: assertion `container != NULL' failed

** (valac:15280): CRITICAL **: vala_ccode_function_call_add_argument: assertion `expr != NULL' failed
$ grep 'test_construct (GType.*{' -A6 -n Test.c
60:static Test* test_construct (GType object_type, gint val) {
61-	Test* self;
62-	self = (Test*) g_type_create_instance (object_type);
63-	test_set_x (val);
64-	test_nop (self);
65-	return self;
66-}
Comment 1 Jürg Billeter 2009-10-28 14:24:34 UTC
commit d040b40d58f14b03e602f493bd5e551b62e0b1e0
Author: Jürg Billeter <j@bitron.ch>
Date:   Wed Oct 28 15:18:54 2009 +0100

    Fix static property access in instance methods
    
    Fixes bug 599892.