2008-05-08 Juerg Billeter <j@bitron.ch>
* vala/valasemanticanalyzer.vala:
Report error when trying to create instance of static class,
patch by Andreas Brauchli, fixes bug 516779
svn path=/trunk/; revision=1342
2008-05-08 Jürg Billeter <j@bitron.ch>
* vala/valasemanticanalyzer.vala:
+
+ Report error when trying to create instance of static class,
+ patch by Andreas Brauchli, fixes bug 516779
+
+2008-05-08 Jürg Billeter <j@bitron.ch>
+
+ * vala/valasemanticanalyzer.vala:
* vala/valastruct.vala:
Check number of type arguments in object creation expression,
return;
}
+ if (cl.is_static) {
+ expr.static_type = null;
+ expr.error = true;
+ Report.error (expr.source_reference, "Can't create instance of static class `%s'".printf (cl.get_full_name ()));
+ return;
+ }
+
if (expr.symbol_reference == null) {
expr.symbol_reference = cl.default_construction_method;
}