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 607955 - Symbol resolving broken for base types of structs
Symbol resolving broken for base types of structs
Status: RESOLVED FIXED
Product: vala
Classification: Core
Component: Semantic Analyzer
0.7.x
Other All
: High blocker
: ---
Assigned To: Vala maintainers
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2010-01-24 18:02 UTC by Sandino Flores-Moreno
Modified: 2010-02-04 16:22 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
x11.patch as sent by pancake (593 bytes, patch)
2010-01-24 18:02 UTC, Sandino Flores-Moreno
rejected Details | Review

Description Sandino Flores-Moreno 2010-01-24 18:02:58 UTC
Created attachment 152162 [details] [review]
x11.patch as sent by pancake

Quoting:
http://mail.gnome.org/archives/vala-list/2010-January/msg00136.html

Using Gdk and X11 packages results in a compilation error:


x11.vapi:295.2-295.32: error: The base type `Gdk.Drawable` of struct `X.Window` is not a struct

public struct Window : Drawable {

x11.vapi:284.27-284.28: error: The type name `ID' could not be found
       public struct Drawable : ID


patch is attached. But probably Vala should priorize the name resolution if the type is defined inside the same namespace (this solution will be better, but will require a patch in vala compiler)

This is only broken in git. 0.7.9 is ok

--pancake
Comment 1 pancake 2010-01-25 13:36:00 UTC
I cannot reproduce this issue with current vala-git, so I think that it's time to close this ticket. Sorry for the noise.
Comment 2 Sandino Flores-Moreno 2010-01-25 15:22:05 UTC
Closing since pancake could not reproduce it.
Comment 3 Sandino Flores-Moreno 2010-01-26 19:02:42 UTC
The issue is still happening.
The next one is a test case:

[test.vala]

void main(string[] args)
{
	Gtk.init(ref args);
	var window = new Gtk.Window(0);
	window.realize();
	uint32 xid = Gdk.x11_drawable_get_xid(window.window);
	print("The WID is %h", xid);
	window.show_all();
	Gtk.main();
}

[/test.vala]

$ valac test.vala --pkg gtk+-2.0 --pkg gdk-x11-2.0
x11.vapi:295.2-295.32: error: The base type `Gdk.Drawable` of struct `X.Window` is not a struct
	public struct Window : Drawable {
	^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Compilation failed: 1 error(s), 0 warning(s)
Comment 4 Evan Nemerson 2010-01-27 05:30:28 UTC
It would be better to resolve the real issue, instead of working around it by patching the vapi--especially since it was working in 0.7.9. I've gone ahead and used your test case to do a bisect:


c1ee2f13806678f7b8a3e9a058b62e31fcbc7a2d is the first bad commit
commit c1ee2f13806678f7b8a3e9a058b62e31fcbc7a2d
Author: Jürg Billeter <j@bitron.ch>
Date:   Thu Jan 14 12:51:00 2010 +0100

    Fix order dependency in type resolution with derived integer types

:040000 040000 c2523be75d4b1d006470b05fa11f5854ee847ec8 c74a8a3732a74ca49f439aab524798b3625f16ca M	vala
bisect run success
Comment 5 Jürg Billeter 2010-01-27 17:48:56 UTC
This is a bug in the symbol resolver.
Comment 6 Jürg Billeter 2010-02-04 16:22:22 UTC
commit e3a8480ff498d2fae7c90448bfc86e7ea50c2dff
Author: Jürg Billeter <j@bitron.ch>
Date:   Thu Feb 4 17:20:08 2010 +0100

    Fix symbol resolving for base types of structs
    
    Fixes bug 607955.