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 752364 - The Genie syntax does not support (owned) arrays of unowned data type
The Genie syntax does not support (owned) arrays of unowned data type
Status: RESOLVED OBSOLETE
Product: vala
Classification: Core
Component: Genie
unspecified
Other All
: Normal normal
: ---
Assigned To: Jamie McCracken
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2015-07-14 09:50 UTC by Jens Mühlenhoff
Modified: 2018-05-22 15:25 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Jens Mühlenhoff 2015-07-14 09:50:51 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)
Comment 1 GNOME Infrastructure Team 2018-05-22 15:25:23 UTC
-- 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.