After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 760724 - error "Incompatible operand" when adding arrays
error "Incompatible operand" when adding arrays
Status: RESOLVED DUPLICATE of bug 623856
Product: vala
Classification: Core
Component: Arrays
0.30.x
Other Linux
: Normal normal
: ---
Assigned To: Vala maintainers
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2016-01-16 18:13 UTC by post
Modified: 2018-02-26 08:01 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description post 2016-01-16 18:13:45 UTC
i want to add 2 arrays.

this is not working:

const beziehung_m : array of string = {"Vater", "Bruder", "Mann", "Sohn", "Onkel", "Opa", "Cousin", "Freund", "Kollege", "Mitbewohner"}
const beziehung_w : array of string = {"Mutter", "Schwester", "Frau", "Tochter", "Tante", "Oma", "Cousine", "Freundin", "Kollegin", "Mitbewohnerin"}
const beziehung = beziehung_m + beziehung_w

error: syntax error, expected `:' but got `=' with previous unknown token

it should get the type from the other arrays. but also if i provide the type with:

const beziehung : array of string = beziehung_m + beziehung_w

error: Incompatible operand
Comment 1 Florian Brosch 2016-01-21 21:35:40 UTC
I don't know much about genie but (array)+(array) is not supported in vala. Use GLib.Memory.copy to build a new array.
Comment 2 Michael 'Mickey' Lauer 2018-02-26 08:01:21 UTC

*** This bug has been marked as a duplicate of bug 623856 ***