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 627093 - error with a dynamic array in a public struct
error with a dynamic array in a public struct
Status: RESOLVED DUPLICATE of bug 570821
Product: vala
Classification: Core
Component: Structs
unspecified
Other Linux
: Normal enhancement
: ---
Assigned To: Vala maintainers
Vala maintainers
test-case
Depends on:
Blocks:
 
 
Reported: 2010-08-16 22:46 UTC by Sébastien Wilmet
Modified: 2010-09-09 17:03 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Sébastien Wilmet 2010-08-16 22:46:36 UTC
Compile this program:

public struct MyStruct
{
    public int[] array;
}

int main ()
{
    MyStruct test = MyStruct ();
    test.array += 1;
    test.array += 2;

    stdout.printf ("%d\n", test.array[1]);

    return 0;
}

And you will get this GCC error:
error: ‘MyStruct’ has no member named ‘_array_size_’

If I declare MyStruct without the "public" keyword, everything works fine.
Comment 1 Marc-Andre Lureau 2010-08-17 00:53:17 UTC
confirmed with vala 0.9.5-22-gaef8d07

(test case added to vala-tests)
Comment 2 Jürg Billeter 2010-09-09 16:08:29 UTC
commit 89c0afc73b3d0d9aa34403f831361610c1bddf45
Author: Jürg Billeter <j@bitron.ch>
Date:   Thu Sep 9 17:58:10 2010 +0200

    codegen: Report error on unsupported use of array concatenation
Comment 3 Jürg Billeter 2010-09-09 17:03:54 UTC
Thanks for the bug report. This particular bug has already been reported into our bug tracking system, but please feel free to report any further bugs you find.

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