Hi,
I was trying to use @main using a swift executable swift package init --type executable
. The code below builds and runs in Xcode but when I try to run the code in terminal I get the error " 'main' attribute cannot be used in a module that contains top-level code". I was wondering why that might be and if this might be a bug? I am still fairly new with Swift, thanks for your help in advance.
@main
struct Test {
static func main() {
print("hello")
}
}