File tree Expand file tree Collapse file tree 1 file changed +24
-7
lines changed Expand file tree Collapse file tree 1 file changed +24
-7
lines changed Original file line number Diff line number Diff line change @@ -626,14 +626,31 @@ $(GNAME MixinDeclaration):
626
626
$(D mixin) $(D $(LPAREN)) $(GLINK2 expression, ArgumentList) $(D $(RPAREN)) $(D ;)
627
627
)
628
628
629
- $(P Each $(GLINK2 expression, AssignExpression) in the $(I ArgumentList) is
630
- evaluated at compile time, and the result must be representable
631
- as a string.
632
- The resulting strings are concatenated to form a string.
633
- The text contents of the string must be compilable as a valid
634
- $(GLINK DeclDefs), and is compiled as such.
635
- )
629
+ $(P Each $(GLINK2 expression, AssignExpression) in the $(I ArgumentList) is
630
+ evaluated at compile time, and the result must be representable
631
+ as a string.
632
+ The resulting strings are concatenated to form a string.
633
+ The text contents of the string must be compilable as a valid
634
+ $(GLINK DeclDefs), and is compiled as such.)
636
635
636
+ $(P The content of a mixin cannot be forward referenced by other DeclDefs of
637
+ the same scope because it is not yet pulled in the AST.)
638
+
639
+ ---------
640
+ class B : A {} // Error: undefined identifier `A`
641
+ mixin ("class A {}");
642
+ ---------
643
+
644
+ $(P Forward references may only work in function bodies because they
645
+ are processed after the declarations)
646
+
647
+ ---------
648
+ void v()
649
+ {
650
+ class B : A {}
651
+ }
652
+ mixin ("class A {}");
653
+ ---------
637
654
638
655
$(H2 $(LEGACY_LNAME2 PackageModule, package-module, Package Module))
639
656
You can’t perform that action at this time.
0 commit comments