Skip to content

ZNTC0405: Class declaration is not allowed in statement position

Class declaration is not allowed in statement position

Category: Parser: Declaration/Class

if (true) class Foo {}

Reproduce in Playground →

See the error message for cause and resolution.