Jump to content

Conditional structures: Difference between revisions

m
→‎case without a default: the error discussed isn’t syntactic
m (→‎case expressions: Highlight variables in text as italic)
m (→‎case without a default: the error discussed isn’t syntactic)
 
Line 615:
===case without a default===
When there is no '''when others''' clause, the compiler will complain about any uncovered alternative. This defends against a common reason for bugs in other languages.
I.e., the following code is syntactically incorrect:
 
<syntaxhighlight lang="ada">case Today is
Line 627:
end case;</syntaxhighlight>
 
The syntactically correct version:
 
<syntaxhighlight lang="ada">case Today is
6

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.