Re: [Vala] Is there any way to access generic type from the interface?

2016-02-27 Thread Felipe Lavratti
Hey Marcin,

What is exactly you need from interfaces in your code ?Are you doing
Dependency Inversion?

Felipe


On Sat, Feb 27, 2016 at 4:40 PM Daniel Espinosa  wrote:

> Is not valid code. Interfaces should "derive" from Object. Interfaces list
> dependencies, the first one should be Object, then other interfaces depends
> on, the order matters, because if other interfaces depends on same, they
> should be added first.
>
> For your question, use typeof(G)
> El feb. 27, 2016 1:26 PM, "Felipe Lavratti" 
> escribió:
>
>> I don't know if your code is valid Vala. MyInterface should not inherit
>> MyClass.
>>
>> On Sat, Feb 27, 2016 at 10:59 mar...@saepia.net 
>> wrote:
>>
>> > Hello,
>> >
>> > I am planning to use interfaces as in vspec as they are nice syntax
>> sugar
>> > for my purpose.
>> >
>> > However, in order to make it working properly, I need to access type
>> > defined as generic in the parent class implementing interface. Something
>> > like
>> >
>> > public interface MyIface : MyClass {
>> >   public MyGenericType something() {
>> > ...
>> >   }
>> > }
>> >
>> >
>> > public abstract class MyClass : MyIface {
>> >
>> > }
>> >
>> >
>> > Is it possible in any way?
>> >
>> > m.
>> > ___
>> > vala-list mailing list
>> > vala-list@gnome.org
>> > https://mail.gnome.org/mailman/listinfo/vala-list
>> >
>> ___
>> vala-list mailing list
>> vala-list@gnome.org
>> https://mail.gnome.org/mailman/listinfo/vala-list
>>
>
___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] Is there any way to access generic type from the interface?

2016-02-27 Thread Daniel Espinosa
Is not valid code. Interfaces should "derive" from Object. Interfaces list
dependencies, the first one should be Object, then other interfaces depends
on, the order matters, because if other interfaces depends on same, they
should be added first.

For your question, use typeof(G)
El feb. 27, 2016 1:26 PM, "Felipe Lavratti"  escribió:

> I don't know if your code is valid Vala. MyInterface should not inherit
> MyClass.
>
> On Sat, Feb 27, 2016 at 10:59 mar...@saepia.net  wrote:
>
> > Hello,
> >
> > I am planning to use interfaces as in vspec as they are nice syntax sugar
> > for my purpose.
> >
> > However, in order to make it working properly, I need to access type
> > defined as generic in the parent class implementing interface. Something
> > like
> >
> > public interface MyIface : MyClass {
> >   public MyGenericType something() {
> > ...
> >   }
> > }
> >
> >
> > public abstract class MyClass : MyIface {
> >
> > }
> >
> >
> > Is it possible in any way?
> >
> > m.
> > ___
> > vala-list mailing list
> > vala-list@gnome.org
> > https://mail.gnome.org/mailman/listinfo/vala-list
> >
> ___
> vala-list mailing list
> vala-list@gnome.org
> https://mail.gnome.org/mailman/listinfo/vala-list
>
___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] Is there any way to access generic type from the interface?

2016-02-27 Thread Felipe Lavratti
I don't know if your code is valid Vala. MyInterface should not inherit
MyClass.

On Sat, Feb 27, 2016 at 10:59 mar...@saepia.net  wrote:

> Hello,
>
> I am planning to use interfaces as in vspec as they are nice syntax sugar
> for my purpose.
>
> However, in order to make it working properly, I need to access type
> defined as generic in the parent class implementing interface. Something
> like
>
> public interface MyIface : MyClass {
>   public MyGenericType something() {
> ...
>   }
> }
>
>
> public abstract class MyClass : MyIface {
>
> }
>
>
> Is it possible in any way?
>
> m.
> ___
> vala-list mailing list
> vala-list@gnome.org
> https://mail.gnome.org/mailman/listinfo/vala-list
>
___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


[Vala] Is there any way to access generic type from the interface?

2016-02-27 Thread mar...@saepia.net
Hello,

I am planning to use interfaces as in vspec as they are nice syntax sugar
for my purpose.

However, in order to make it working properly, I need to access type
defined as generic in the parent class implementing interface. Something
like

public interface MyIface : MyClass {
  public MyGenericType something() {
...
  }
}


public abstract class MyClass : MyIface {

}


Is it possible in any way?

m.
___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list