Re: [Vala] var + unowned
- From: Luca Bruno <lethalman88 gmail com>
- To: rastersoft <raster rastersoft com>
- Cc: Vala List <vala-list gnome org>
- Subject: Re: [Vala] var + unowned
- Date: Tue, 31 Dec 2013 23:36:47 +0100
Yes, no type inference for unowned variables, sorry. That's a deficiency we
hope to overcome at some point.
On Tue, Dec 31, 2013 at 9:23 PM, rastersoft <raster rastersoft com> wrote:
Hi all:
I'm creating a VAPI, and one of the constructors is defined as:
public static unowned Icccm new(Xcb.Connection conn) {
unowned Xcb.Icccm.Icccm retval = (Xcb.Icccm.Icccm)conn;
return retval;
}
The idea is to create an Icccm object that is, in fact, a Xcb.Connection
object in disguise. The problem is that all these calls return an error:
var icccm = Xcb.Icccm.new(this.conn);
unowned var icccm = Xcb.Icccm.new(this.conn);
var unowned icccm = Xcb.Icccm.new(this.conn);
and the only way to create a new object is using:
unowned Xcb.Icccm.Icccm icccm = Xcb.Icccm.new(this.conn);
Am I doing something wrong, or really the vala compiler doesn't allow to
use type inference and unowned types?
Thanks!
--
Nos leemos
RASTER (Linux user #228804)
raster rastersoft com http://www.rastersoft.com
_______________________________________________
vala-list mailing list
vala-list gnome org
https://mail.gnome.org/mailman/listinfo/vala-list
--
www.debian.org - The Universal Operating System
[
Date Prev][Date Next] [
Thread Prev][Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]