Non-simple generics should be forbidden on methods with params-array
Example:
struct Map<K,V>{
K k;
V v;
}
void reproducer<K,V>(params Map?[] maps){
K k = maps[0].k;
}
void main(){
reproducer<int,string>({Map<int,string>(){k=1, v="1"}});
}
C Error:
incompatible types in assigning "gpointer" {aka " void *"} type values to "Map" {aka "struct _Map»}
C Code:
void
_vala_main (void)
{
gchar* _tmp0_;
Map _tmp1_ = {0};
Map _tmp2_;
Map _tmp3_ = {0};
Map _tmp4_;
_tmp0_ = g_strdup ("1");
memset (&_tmp1_, 0, sizeof (Map));
_tmp1_.k = (gpointer) ((gintptr) 1);
_tmp1_.v = _tmp0_;
_tmp2_ = _tmp1_;
_tmp3_.k = _tmp2_; // HERE ERROR
_tmp4_ = &_tmp3_;
reproducer (G_TYPE_INT, NULL, NULL, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, &_tmp4_, NULL);
map_destroy (&_tmp2_);
}
Edited by Corentin Noël