4 runnable/test17684.d(37): Deprecation: alias this for classes/interfaces is deprecated
5 runnable/test17684.d(54): Deprecation: alias this for classes/interfaces is deprecated
6 runnable/test17684.d(54): Deprecation: alias this for classes/interfaces is deprecated
7 runnable/test17684.d(37): Deprecation: alias this for classes/interfaces is deprecated
14 static alias Field
this;
17 struct StructProperty(T
)
21 static @property T
property()
26 static @property void property(T value
)
31 static alias property
this;
37 static alias Field
this;
40 class ClassProperty(T
)
44 static @property T
property()
49 static @property void property(T value
)
54 static alias property
this;
61 t
= false; // tests AssignExp
64 bool boolValue
= t
; // tests AssignExp
65 assert(boolValue
== false);
67 t
= !t
; // tests NotExp
71 assert(boolValue
== true);
73 assert(boolValue
&& t
); // tests AndAndExp
74 assert(t
&& boolValue
);
77 assert(boolValue || t
); // tests OrOrExp
78 assert(t || boolValue
);
80 assert(t
!= boolValue
); // tests CmpExp
81 assert(boolValue
!= t
);
84 assert(t
== boolValue
);
85 assert(boolValue
== t
);
87 t
= true; // tests inferType
88 auto inferredValue
= t
;
89 assert(inferredValue
== true);
91 t
= true; // tests function argument
92 bool functionCall(bool test)
96 assert(t
== functionCall(t
));
98 t
= true; // tests CastExp
99 assert(t
== cast(bool)t
);
102 return t
; // tests ReturnStatement
109 t
= 42; // tests AssignExp
113 assert(intValue
== 42);
115 assert(t
== 42); // tests CmpExp
124 t
= 42; // tests CastExp
125 assert(42 == cast(int)t
);
127 // These currently don't work for properties due to https://issues.dlang.org/show_bug.cgi?id=8006
128 static if (!(typeid(T
) is typeid(StructProperty
!int)) && !(typeid(T
) is typeid(ClassProperty
!int)))
130 t
++; // test a few unary and binary operators
143 assert(~t
== ~42); // tests ComExp
145 return t
; // tests ReturnStatement
150 assert(boolTest
!(StructField
!(bool))());
151 assert(boolTest
!(StructProperty
!(bool))());
152 assert(boolTest
!(ClassField
!(bool))());
153 assert(boolTest
!(ClassProperty
!(bool))());
155 assert(intTest
!(StructField
!(int))() == 42);
156 assert(intTest
!(StructProperty
!(int))() == 42);
157 assert(intTest
!(ClassField
!(int))() == 42);
158 assert(intTest
!(ClassProperty
!(int))() == 42);