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-13603] public let bindings missing from swiftinterface (!) #56038

Closed
typesanitizer opened this issue Sep 24, 2020 · 3 comments
Closed

[SR-13603] public let bindings missing from swiftinterface (!) #56038

typesanitizer opened this issue Sep 24, 2020 · 3 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself library evolution Feature: library evolution (umbrella feature for features that facilitate resilient libraries)

Comments

@typesanitizer
Copy link

Previous ID SR-13603
Radar rdar://problem/69530808
Original Reporter @typesanitizer
Type Bug
Status Closed
Resolution Duplicate
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, LibraryEvolution
Assignee None
Priority Medium

md5: e1730ec4b0f59f6aedd37a1acc57cba0

duplicates:

  • SR-13790 emit-module-interface mishandles top-level let bindings

Issue Description:

$ cat hello.swift
public let hello : String = "hello"
$ xcrun swiftc hello.swift -enable-library-evolution -emit-module-interface-path hello.swiftinterface
$ cat hello.swiftinterface
// flags blah blah
import Swift

It's surprising that there is no public let hello : String in the swiftinterface. Surely this is a bug? Tested with Xcode 12 as well as master.

@typesanitizer
Copy link
Author

@swift-ci create

@slavapestov
Copy link
Member

Top-level globals in the main source file are not part of a module's public interface. You need to pass -parse-as-library, too.

However I notice that there's still a bug because we print the global variable as a "var", making it mutable, which is not correct.

@typesanitizer
Copy link
Author

Closing this in favor of https://bugs.swift.org/browse/SR-13790

@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 library evolution Feature: library evolution (umbrella feature for features that facilitate resilient libraries)
Projects
None yet
Development

No branches or pull requests

2 participants