Incorrect error messages #72327
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
triage needed
This issue needs more specific labels
Description
The code shown below shows not helpful and incorrect errors:
Either
@main
as top-level code should work or the error should give a hint how to fix this.This message should not be shown when using
swift
:The error related to URL is correct. Replacing the body of
func main
withprint("hello world")
does not change the other errors.Reproduction
Copy the following code (from Hacking With Swift) into a new file, e.g.
xxx.swift
:Try to run the code using
swift xxx.swift
results in the following errors:Expected behavior
@main
if you use@main
”.swiftc
. Forswift
, use … instead”)Environment
$ swiftc -version
Swift version 5.9 (swift-5.9-RELEASE)
Target: x86_64-unknown-linux-gnu
Additional information
No response
The text was updated successfully, but these errors were encountered: