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-12821] Symbol is in generated IR file, but not in TBD file #55267

Closed
theblixguy opened this issue May 15, 2020 · 2 comments
Closed

[SR-12821] Symbol is in generated IR file, but not in TBD file #55267

theblixguy opened this issue May 15, 2020 · 2 comments
Assignees
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself

Comments

@theblixguy
Copy link
Collaborator

Previous ID SR-12821
Radar rdar://problem/63364542
Original Reporter @theblixguy
Type Bug
Status Resolved
Resolution Done
Environment

Xcode 11.4.1 w/ Swift 5.3 snapshot (11th May 2020). macOS Catalina 10.15.4

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug
Assignee @theblixguy
Priority Medium

md5: a0c53f290b235c9d6bb2cbd3addcb319

relates to:

  • SR-15938 Error when referencing #dsohandle in a Swift test on Windows

Issue Description:

Reproducer (taken directly from SE-0280 proposal):

protocol DecodingError {
  static var fileCorrupted: Self { get }
  static func keyNotFound(_ key: String) -> Self
}

enum JSONDecodingError: DecodingError {
  case fileCorrupted
  case keyNotFound(_ key: String)
}

When building using Xcode, I get the following error:

<unknown>:0: error: symbol '$s9SwiftTest17JSONDecodingErrorO11keyNotFoundyACSScACmF' (SwiftTest.JSONDecodingError.keyNotFound(SwiftTest.JSONDecodingError.Type) -> (Swift.String) -> SwiftTest.JSONDecodingError) is in generated IR file, but not in TBD file
<unknown>:0: error: symbol '$s9SwiftTest17JSONDecodingErrorO13fileCorruptedyA2CmF' (SwiftTest.JSONDecodingError.fileCorrupted(SwiftTest.JSONDecodingError.Type) -> SwiftTest.JSONDecodingError) is in generated IR file, but not in TBD file
<unknown>:0: error: please file a radar or open a bug on bugs.swift.org with this code, and add -Xfrontend -validate-tbd-against-ir=none to squash the errors

You can also reproduce this from the command-line:

./swiftc -frontend -emit-ir -validate-tbd-against-ir=missing -enable-testing -sdk $(xcrun --show-sdk-path) ~/Desktop/test.swift
@theblixguy
Copy link
Collaborator Author

@slavapestov I remember you said that TBDGen doesn't need to visit enum constructors because they don't have public visibility. So, I am wondering if we need to make TBD verification more tolerant in this case if these symbols shouldn't be in the TBD file, or should we add these symbols anyway?

@theblixguy
Copy link
Collaborator Author

Fixed by #31826 and cherry picked to 5.3: #31886

I’ll verify with the next available snapshots.

@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
Projects
None yet
Development

No branches or pull requests

1 participant