GNOME Bugzilla – Bug 752364
The Genie syntax does not support (owned) arrays of unowned data type
Last modified: 2018-05-22 15:25:23 UTC
Taken from this stackoverflow question: http://stackoverflow.com/questions/31381380/genie-how-to-return-an-array-of-unowned-strings There seems to be no way in the current Genie syntax to declare an (owned) array of a unowned data type. [indent=4] init var str = "ABC" unowned_string_array: array of (unowned string) = repeat (str, 5) def repeat (s: string, n: int): array of (unowned string) a: array of (unowned string) = new array of (unowned string)[n] for var i = 1 to n a[i] = s return a The error messages are: unowned.gs:6.36-6.36: error: syntax error, expected identifier unowned_string_array: array of (unowned string) = repeat (str, 5) ^ unowned.gs:8.42-8.42: error: syntax error, expected identifier def repeat (s: string, n: int): array of (unowned string) ^ Compilation failed: 2 error(s), 0 warning(s)
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/vala/issues/506.