Swift @main attribute causes compile to fail, on code from official docs

Question:
Why does Repl.it tell me

main.swift:1:1: error: 'main' attribute cannot be used in a module that contains top-level code
@main
^
main.swift:1:1: note: top-level code defined in this source file
@main
^

When this code:

@main
struct MyTopLevel {
    static func main() {
        // Top-level code goes here
    }
}

was copied directly from the swift documentation?

For the record, running code at the top level with no main method works fine. But I need to do this because Swift doesn’t allow users to run async code at the top level.

Repl link/Link to where the bug appears:
https://replit.com/@duryesch000/swift-being-awful#main.swift

I found a forum post which suggests this is a Swift problem and not a repl.it problem.

Had to do swiftc -parse-as-library main.swift && ./main. Was only doing this because I wanted to use async. Apparently Swift actually supports async in top-level now but the version on Repl.it is just old and crusty.