]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
codegen: Do not create unused real functions for interface methods
authorJürg Billeter <j@bitron.ch>
Tue, 21 Dec 2010 20:51:01 +0000 (21:51 +0100)
committerJürg Billeter <j@bitron.ch>
Tue, 21 Dec 2010 20:51:01 +0000 (21:51 +0100)
codegen/valaccodemethodmodule.vala

index c2d4b880ff4cb5349d16daedd28018c3c65249b2..428dac1e6a30d4b74e3bc5a129a9443a6c15dba0 100644 (file)
@@ -331,14 +331,8 @@ public abstract class Vala.CCodeMethodModule : CCodeStructModule {
                                } else if (m.is_private_symbol ()) {
                                        function.modifiers |= CCodeModifiers.STATIC;
                                }
-                       }
-               }
-
-               // generate *_real_* functions for virtual methods
-               // also generate them for abstract methods of classes to prevent faulty subclassing
-               if (!m.is_abstract || (m.is_abstract && current_type_symbol is Class)) {
-                       if (m.body != null) {
-                               if (m.coroutine) {
+                       } else {
+                               if (m.body != null) {
                                        function = new CCodeFunction (m.get_real_cname () + "_co", "gboolean");
 
                                        // data struct to hold parameters, local variables, and the return value
@@ -644,7 +638,7 @@ public abstract class Vala.CCodeMethodModule : CCodeStructModule {
                        }
                }
 
-               if (m.is_abstract) {
+               if (m.is_abstract && current_type_symbol is Class) {
                        // generate helpful error message if a sublcass does not implement an abstract method.
                        // This is only meaningful for subclasses implemented in C since the vala compiler would
                        // complain during compile time of such en error.