]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Report error when declaring virtual methods as extern
authorJürg Billeter <j@bitron.ch>
Tue, 28 Jul 2009 16:33:06 +0000 (18:33 +0200)
committerJürg Billeter <j@bitron.ch>
Tue, 28 Jul 2009 16:33:06 +0000 (18:33 +0200)
See bug 584400.

vala/valamethod.vala

index 79e9d5c00f15005422c19210eaa519da451ef079..7fad756854d0aa2ab0594ecca71fa4457a03befd 100644 (file)
@@ -690,6 +690,8 @@ public class Vala.Method : Member {
 
                if (is_abstract && body != null) {
                        Report.error (source_reference, "Abstract methods cannot have bodies");
+               } else if ((is_abstract || is_virtual) && external && !external_package) {
+                       Report.error (source_reference, "Extern methods cannot be abstract or virtual");
                } else if (external && body != null) {
                        Report.error (source_reference, "Extern methods cannot have bodies");
                } else if (!is_abstract && !external && !external_package && body == null) {