We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9ad4c39 commit d21b7c2Copy full SHA for d21b7c2
spec/declaration.dd
@@ -470,13 +470,17 @@ alias abc = foo.bar; // is it a type or a symbol?
470
$(P Aliases cannot be used for expressions:)
471
472
-----------
473
-struct S { static int i; }
474
-S s;
+struct S
+{
475
+ static int i;
476
+ static int j;
477
+}
478
-alias a = s.i; // ok, s.i is a symbol
-alias b = S.i; // ok, S.i also is a symbol
-alias c = a + b; // illegal, a + b is an expression
479
-b = 4; // sets S.i to 4
+alias a = S.i; // OK, `S.i` is a symbol
480
+alias b = S.j; // OK. `S.j` is also a symbol
481
+alias c = a + b; // illegal, `a + b` is an expression
482
+a = 2; // sets `S.i` to `2`
483
+b = 4; // sets `S.j` to `4`
484
485
486
$(H2 $(LNAME2 extern, Extern Declarations))
0 commit comments