-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Open
Labels
compilerThe Swift compiler itselfThe Swift compiler itselfdiagnostics QoIBug: Diagnostics Quality of ImplementationBug: Diagnostics Quality of Implementationgood first issueGood for newcomersGood for newcomersimprovementlegacy driverArea → compiler: the integrated C++ legacy driver. Succeeded by the swift-driver projectArea → compiler: the integrated C++ legacy driver. Succeeded by the swift-driver project
Description
| Previous ID | SR-4716 |
| Radar | None |
| Original Reporter | @huonw |
| Type | Improvement |
| Status | In Progress |
| Resolution |
Additional Detail from JIRA
| Votes | 0 |
| Component/s | Compiler |
| Labels | Improvement, DiagnosticsQoI, Driver, StarterBug |
| Assignee | None |
| Priority | Medium |
md5: 107a386ff1ef4614f95e66bc776c43f4
Issue Description:
$ touch file1.swift file2.swift
$ swiftc file1.swift file2.swift
Undefined symbols for architecture x86_64:
"_main", referenced from:
implicit entry/start for main executable
ld: symbol(s) not found for architecture x86_64
<unknown>:0: error: link command failed with exit code 1 (use -v to see invocation)
The problem here is neither file is called main.swift, so the top-level-code `main` function doesn't get emitted. The compiler should check the file names and emit an error rather than going all the way through compilation to hit the link error.
Metadata
Metadata
Assignees
Labels
compilerThe Swift compiler itselfThe Swift compiler itselfdiagnostics QoIBug: Diagnostics Quality of ImplementationBug: Diagnostics Quality of Implementationgood first issueGood for newcomersGood for newcomersimprovementlegacy driverArea → compiler: the integrated C++ legacy driver. Succeeded by the swift-driver projectArea → compiler: the integrated C++ legacy driver. Succeeded by the swift-driver project