GNOME Bugzilla – Bug 683686
Compilation error with SimpleType struct
Last modified: 2017-03-09 21:21:58 UTC
Following code throws an error by the native C compiler: [SimpleType] struct Foo { float bar; public Foo (float bar) { this.bar = bar * 2; } public void add (float a) { this.bar += a; } public float get_bar () { return this.bar; } } void main () { Foo foo = Foo (2.5f); foo.add (3.5f); stdout.printf ("%f\n", foo.get_bar ()); } The error occurs in the foo_init function, when the self parameter is passed to memset. The self parameter should cast to a void* pointer;
*** This bug has been marked as a duplicate of bug 741466 ***