The Genie syntax does not support (owned) arrays of unowned data type
Submitted by Jens Mühlenhoff
Link to original bug (#752364)
Description
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)