07-18-2023, 03:30 PM
Is there anything special with a `main.swift` file?
I have created a command line based project in XCode. If I put an expression `println("Hello, World!");` in a new swift file says test.swift, I will get the error message: `Expressions are not allowed at the top level`
However this expression is placed at top level in the main.swift that is created by XCode in the new project. No such exception is flagged by XCode.
I have created a command line based project in XCode. If I put an expression `println("Hello, World!");` in a new swift file says test.swift, I will get the error message: `Expressions are not allowed at the top level`
However this expression is placed at top level in the main.swift that is created by XCode in the new project. No such exception is flagged by XCode.