add struct property member failed
I have met a problem about struct property, the test code as follow:
public class MyMutex : GLib.Object
{
private int m_private_value;
private Mutex m_mutex;
public int m_public_value;
construct {
m_private_value = 10;
m_public_value = 10;
m_mutex = Mutex();
}
public Mutex mutex {
get { return m_mutex; }
}
}
int main (string[] args) {
MyMutex my_mutex = new MyMutex();
my_mutex.m_public_value = 20;
return 0;
}
vala compiler output the follow message:
$ vala mutex.vala --save-temps
D:/Temp/mutex.c: In function 'my_mutex_class_init':
D:/Temp/mutex.c:123:178: error: 'G_TYPE_MUTEX' undeclared (first use in this function); did you mean 'G_TYPE_DATE'?
123 | g_object_class_install_property (G_OBJECT_CLASS (klass), MY_MUTEX_MUTEX_PROPERTY, my_mutex_properties[MY_MUTEX_MUTEX_PROPERTY] = g_param_spec_boxed ("mutex", "mutex", "mutex", G_TYPE_MUTEX, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
| ^~~~~~~~~~~~
| G_TYPE_DATE
D:/Temp/mutex.c:123:178: note: each undeclared identifier is reported only once for each function it appears in
Compilation failed: 1 error(s), 0 warning(s)
error: cc exited with status 1