Skip to content

Commit de6d3c9

Browse files
committed
Make QualCast examples compiled
1 parent 51a7b93 commit de6d3c9

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

spec/expression.dd

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1191,20 +1191,24 @@ $(GNAME CastQual):
11911191
$(P A $(I CastQual) replaces the qualifiers in the type of
11921192
the $(I UnaryExpression):)
11931193

1194+
$(SPEC_RUNNABLE_EXAMPLE_COMPILE
11941195
---
11951196
shared int x;
1196-
assert(is(typeof(cast(const)x) == const int));
1197+
static assert(is(typeof(cast(const)x) == const int));
11971198
---
1199+
)
11981200

11991201
$(P Casting with no type or qualifiers removes
12001202
any top level $(D const), $(D immutable), $(D shared) or $(D inout)
12011203
type modifiers from the type
12021204
of the $(I UnaryExpression).)
12031205

1206+
$(SPEC_RUNNABLE_EXAMPLE_COMPILE
12041207
---
12051208
shared int x;
1206-
assert(is(typeof(cast()x) == int));
1209+
static assert(is(typeof(cast()x) == int));
12071210
---
1211+
)
12081212

12091213
$(H3 $(LNAME2 cast_void, Casting to `void`))
12101214

0 commit comments

Comments
 (0)