Why is the ; not required after the end of the enum enuContractStates {Ready, Active, Paused} statement. If I add the ; after this statement I get a compile error.

Thank you

contract Picard {
    string public constant strFullName = "Jean Luc Picard";
    enum enuContractStates {Ready, Active, Paused}
    enuContractStates public state;


1 Answer 1


For the same reasons as to why it shouldn't be used after functions.

; is used to end a statement. A statement is usually introducing a variable or assigning a value to a variable.

However the { } construct is to express a block. You shouldn't use semicolon ; to end a block.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.