After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 548895 - wrong property-accessors code
wrong property-accessors code
Status: RESOLVED FIXED
Product: vala
Classification: Core
Component: Code Generator
0.3.x
Other All
: Normal normal
: ---
Assigned To: Jürg Billeter
Vala maintainers
: 553569 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2008-08-21 18:18 UTC by Florian Brosch
Modified: 2008-09-26 20:34 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
- (2.26 KB, patch)
2008-08-26 07:25 UTC, Florian Brosch
needs-work Details | Review

Description Florian Brosch 2008-08-21 18:18:33 UTC
Please describe the problem:
I hit followiing bug when i tried to compile valadoc with trunk:

-----------------------------------------------
using GLib;

public interface Blaetterkleid : Object {
	public abstract bool is_public {
		get;
	}
}

public class Wurzel : Object {
	public bool is_public {
		get {
			return true;
		}
	}
}

public class Stamm : Wurzel, Blaetterkleid {
}

public class Apfel : Stamm {
	public static int main ( string[] args ) {
		return 0;
	}
}
-----------------------------------------------
static void stamm_blaetterkleid_interface_init (BlaetterkleidIface * iface) {
	stamm_blaetterkleid_parent_iface = g_type_interface_peek_parent (iface);
	iface->get_is_public = stamm_real_get_is_public;
}
-----------------------------------------------
mog@mogulus:~/Desktop$ valac -o food test.vala 
test.c: In Funktion »stamm_blaetterkleid_interface_init«:
test.c:111: Fehler: »stamm_real_get_is_public« nicht deklariert (erste Benutzung in dieser Funktion)
test.c:111: Fehler: (Jeder nicht deklarierte Bezeichner wird nur einmal aufgeführt
test.c:111: Fehler: für jede Funktion in der er auftritt.)
error: cc exited with status 256
Compilation failed: 1 error(s), 0 warning(s)


Steps to reproduce:


Actual results:


Expected results:


Does this happen every time?


Other information:
Comment 1 Florian Brosch 2008-08-26 07:25:28 UTC
Created attachment 117383 [details] [review]
-

The patch should work fine but there are still c-compiler warning for each setter and getter in interfaces. The problem is thedefined function pointer in the interface struct whih doesn't met the generated access-funtions from the classes.

	ValaSourceFile* (*get_get_obj) (Blaetterkleid* self);
	void (*set_get_obj) (Blaetterkleid* self, ValaSourceFile* value);
Comment 2 Jürg Billeter 2008-09-26 20:15:58 UTC
*** Bug 553569 has been marked as a duplicate of this bug. ***
Comment 3 Jürg Billeter 2008-09-26 20:31:05 UTC
Thanks for the patch. The logic is not quite correct in the virtual/override case. I'll fix this and commit.
Comment 4 Jürg Billeter 2008-09-26 20:34:18 UTC
2008-09-26  Jürg Billeter  <j@bitron.ch>

	* gobject/valaccodeclassbinding.vala:

	Use correct accessor cname for interface implementations of
	properties inherited from a base class,
	based on patch by Florian Brosch, fixes bug 548895

Fixed in r1787.