Support class fields in interfaces
@ebassi
Submitted by Emmanuele Bassi Link to original bug (#546440)
Description
I'm attaching an updated version of the interfaces.vala test case which adds an interface public field and then changes its value inside the class constructor:
public abstract class Ibaz : Object {
public class int public_field;
}
public class Baz : Object, Ibaz {
class construct {
public_field = 42;
}
}
will print out a warning:
./testrunner.sh: line 42: 24833 Trace/breakpoint trap $VALAC -C --vapidir "$vapidir" --pkg gee-1.0 --basedir $topsrcdir -d $topbuilddir $testsrc.vala > $testbuild.err 2>&1
ERROR: Compiling ./interfaces.vala
GLib-GObject-WARNING **: invalid cast from `ValaInterface' to `ValaClass'
aborting...
the resulting code does not cast the interface correctly inside the base_init().
Edited by Rico Tzschichholz