Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SR-7658] "not declared" error for declarations after statements in binary mode is confusing #50199

Closed
huonw mannequin opened this issue May 11, 2018 · 0 comments
Closed
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself diagnostics QoI Bug: Diagnostics Quality of Implementation

Comments

@huonw
Copy link
Mannequin

huonw mannequin commented May 11, 2018

Previous ID SR-7658
Radar rdar://problem/40041921
Original Reporter @huonw
Type Bug
Status Resolved
Resolution Duplicate
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, DiagnosticsQoI
Assignee None
Priority Medium

md5: ee0c5fd0d140e6896f4a68f6a6a2127d

duplicates:

  • SR-284 Strange error caused by let/var at specific place in main file.

Issue Description:

func foo(_: S) {}
let x = 1
struct S {}

Compiling this normally gives:

binary.swift:1:13: error: use of undeclared type 'S'
func foo(_: S) {}
            ^

(This works fine in library mode, it's a design decision for binary/"scripting" mode.)

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself diagnostics QoI Bug: Diagnostics Quality of Implementation
Projects
None yet
Development

No branches or pull requests

0 participants