[Vala] Should be warning(maybe error) when method with [ReturnsModifiedPointer] is called from unowned variable




There should be warning(maybe error) when method with
[ReturnsModifiedPointer] is called from unowned variable.

Take a look on GLib.SList. The beginner programer(me too) can be
assign an unowned variable to the list, and remove items, but he
don't know it shell update the owned pointer.

Example:

GLib.SList list = given_list;
list.remove(data);

Naive programers can be fooled(like me) that this code are valid,
since Vala print no errors neither warning.

I think we all agree it's NOT ok, but do you see this as error or warning?

Yours
Tal
                                          


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