On Wed, Jan 16, 2013 at 10:19 AM, Matrix.Zhang <[email protected]>wrote:

> Hi:
>     i'm try to translating the Vala Tutorial (
> https://live.gnome.org/Vala/**Tutorial#Generics<https://live.gnome.org/Vala/Tutorial#Generics>)
>  into chinese.
>
> i have been translated into Chapter 4
>
>     i have two questions:
>
>     1) in section about structs, the Tutorial said **:
>
>             A Vala struct may have methods in a limited way and also may
> have private members, meaning the explicit public access modifier is
> required.
>
>         but i write following code like :
>
>         struct STest {
>
>                 private int member;
>         }
>
>         static int main() {
>
>                 STest s = STest ();
>
>                 s.member = 1;
>
>                 return 0;
>         }
>
>         there was no any errors hint when build the code, but in c#, it
> should error
>
>         i want to know, if it is a bug, or not support actually
>

It's a bug in the compiler that it doesn't error out. Structs can only have
public fields.

-- 
www.debian.org - The Universal Operating System
_______________________________________________
vala-list mailing list
[email protected]
https://mail.gnome.org/mailman/listinfo/vala-list

Reply via email to