You will get the error:
error CS1023: Embedded statement cannot be a declaration or labeled statement
This means that the syntax for the if statement requires an operator or block statement following the conditional expression.
if-stmt -> 'if' '(' expr ')' stmt ['else' stmt]
stmt -> if-stmt
-> do-stmt
-> ...etc...
-> '{' [declaration...] [stmt...] '}'
A declaration is not an instruction, so this is a simple syntax error.
source
share