Skip to content

IRGen: Private opaque result types from another TU are not ABI accessible #38873

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

Conversation

aschwaighofer
Copy link
Contributor

rdar://76416817

@aschwaighofer
Copy link
Contributor Author

@swift-ci Please test

@aschwaighofer aschwaighofer merged commit 0daa9cc into swiftlang:main Aug 18, 2021
aschwaighofer added a commit to aschwaighofer/swift that referenced this pull request Aug 18, 2021
…accessible

Fix a compiler error when using a struct with a private field that has
an opaque result type in another file.

```
% cat A.swift
public protocol P { }
extension Int : P {}
struct Container {
  private let mem : some P = 5
}

% cat B.swift
public func doIt() {
  var x = Container()
  var y = x
}
```

Risk: Low. If the condition matches we will access containing struct's
metadata instead of the fields metadata.

Testing: Swift test added
Reviewed-by: Slava Pestov

Original PR swiftlang#38873

rdar://76416817
tbkka pushed a commit that referenced this pull request Aug 20, 2021
…accessible (#38940)

Fix a compiler error when using a struct with a private field that has
an opaque result type in another file.

```
% cat A.swift
public protocol P { }
extension Int : P {}
struct Container {
  private let mem : some P = 5
}

% cat B.swift
public func doIt() {
  var x = Container()
  var y = x
}
```

Risk: Low. If the condition matches we will access containing struct's
metadata instead of the fields metadata.

Testing: Swift test added
Reviewed-by: Slava Pestov

Original PR #38873

rdar://76416817
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants