Skip to content

Commit 02940bb

Browse files
committed
[spec] Allow multiple message arguments for static assert
Counterpart for: dlang/dmd#14611
1 parent d6fa144 commit 02940bb

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

spec/version.dd

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -741,7 +741,7 @@ $(H2 $(LEGACY_LNAME2 StaticAssert, static-assert, Static Assert))
741741

742742
$(GRAMMAR
743743
$(GNAME StaticAssert):
744-
$(D static assert $(LPAREN)) $(GLINK2 expression, AssertArguments) $(D $(RPAREN) ;)
744+
$(D static assert $(LPAREN)) $(GLINK2 expression, ArgumentList) $(D $(RPAREN) ;)
745745
)
746746

747747
$(P The first $(ASSIGNEXPRESSION) is evaluated at compile time, and converted
@@ -750,6 +750,11 @@ $(GNAME StaticAssert):
750750
and the compile fails.
751751
)
752752

753+
$(P On failure, any subsequent $(I AssignExpression)s will each be
754+
converted to string and then concatenated. The resulting string will
755+
be printed out along with the error diagnostic.
756+
)
757+
753758
$(P Unlike $(GLINK2 expression, AssertExpression)s, $(I StaticAssert)s are always
754759
checked and evaluated by the compiler unless they appear in an
755760
unsatisfied conditional.
@@ -777,10 +782,6 @@ void foo()
777782
configurations not supported in the code.
778783
)
779784

780-
$(P The optional second $(ASSIGNEXPRESSION) can be used to supply
781-
additional information, such as a text string, that will be
782-
printed out along with the error diagnostic.
783-
)
784785
$(SPEC_SUBNAV_PREV_NEXT contracts, Contract Programming, traits, Traits)
785786
)
786787

0 commit comments

Comments
 (0)