@@ -835,7 +835,7 @@ void main()
835
835
are generated without any implicit qualifiers and are not considered
836
836
struct members. This leads to the situation where qualifying an
837
837
entire struct declaration does not have any impact on the above
838
- mentioned postblits, however , since `__xpostblit` is a member of
838
+ mentioned postblits. However , since `__xpostblit` is a member of
839
839
the struct and an alias of one of the other postblits, the qualifiers
840
840
applied to the struct will affect the aliased postblit:)
841
841
@@ -846,8 +846,8 @@ struct S
846
846
{ }
847
847
}
848
848
849
- // `__xpostblit` aliases the aggregated postblit so the `const` applies to it,
850
- // however , the aggregated postblit calls the field postblit which does not have
849
+ // `__xpostblit` aliases the aggregated postblit so the `const` applies to it.
850
+ // However , the aggregated postblit calls the field postblit which does not have
851
851
// any qualifier applied, resulting in a qualifier mismatch error
852
852
const struct B
853
853
{
@@ -862,20 +862,21 @@ const struct B2
862
862
S a;
863
863
}
864
864
865
- // ditto B
865
+ // Similar to B
866
866
immutable struct C
867
867
{
868
868
S a; // error : mutable method C.__fieldPostblit is not callable using a immutable object
869
869
this(this)
870
870
{ }
871
871
}
872
872
873
+ // Similar to B2, compiles
873
874
immutable struct C2
874
875
{
875
876
S a;
876
877
}
877
878
878
- // ditto B
879
+ // Similar to B
879
880
shared struct D
880
881
{
881
882
// error: non-shared method S.__postblit is not callable using a shared object
@@ -884,9 +885,16 @@ shared struct D
884
885
this(this)
885
886
{ }
886
887
}
888
+
889
+ // Unlike B2, this example also does not work due to additional restrictions on shared.
890
+ shared struct D2
891
+ {
892
+ // error: non-shared method S.__postblit is not callable using a shared object
893
+ S a;
894
+ }
887
895
---
888
896
889
- $(P In the above situations the errors do not contain any line numbers because
897
+ $(P In the above situations the errors do not contain line numbers because
890
898
the errors are regarding generated code. In the case of the `shared` struct,
891
899
the first error message can be suppressed by qualifying the postblit of `S`
892
900
with `shared`.
0 commit comments