Re: [Vala] delegates + struct initializer problem
- From: Abderrahim Kitouni <a kitouni gmail com>
- To: Maga Abdurakhmanov <maqdev gmail com>
- Cc: vala-list gnome org
- Subject: Re: [Vala] delegates + struct initializer problem
- Date: Thu, 17 Mar 2011 19:44:18 +0100
في ث، 15-03-2011 عند 01:53 +0300 ، كتب Maga Abdurakhmanov:
Hi!
I'm using structure with delegate field. When I assign that field with
structure initializer, then call to delegate is failed.
Am I doing something wrong or is this a bug in vala? Here is the code
demonstrating problem:
delegate void func();
class test_class : Object {
public void method() {
stdout.printf("method is called\n");
}
}
struct wrapper {
unowned func f;
}
int main(string[] args) {
var t = new test_class();
wrapper w = { f : t.method };
Well, I don't know this syntax. So either it's some obscure syntax that
is buggy, or it is a coincidence that you program compiles. Either way,
this is a bug in the compiler (it should either generate correct code or
report an error).
Anyway, the more conventional syntax
wrapper w = wrapper () {f = t.method};
works.
HTH,
Abderrahim
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]