[Vala] automatic basic type conversions



Actually Vala forces you to pass the correct type for assignations , argument passing in functions, etc..

I think this should be a warning instead of an error. And Vala should know about which basic types can be automatically casted (and show a warning) or an error if they cannot be converted.

For example.

If I have a string and i need a uint8* the cast is possible.

Other basic type conversions that are interesting are between types with precission loss:

 double -> float
 int -> char
 int -> uint32
 ...

In the api bindings i'm writing i use uint32 values for length arguments and i have to cast them
all the time because vala is unable to convert from long to uint32.

I understand that vala should provide a minimal code for making this conversion before calling the function, because a negative value should be handled in a different way (like only pass possitive
value, or so..)

What do you think we should do for this kind of conversions?

--pancake



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]