Skip to content

Conversation

@xymus
Copy link
Contributor

@xymus xymus commented Oct 21, 2025

Replace the here part of the generic exportability diagnostic for variables with: in a property declaration marked public or in a '@frozen' or '@usableFromInline' context.

The full diagnostic now looks like:

error: cannot use struct 'ImportedType' in a property declaration marked public or
in a '@frozen' or '@usableFromInline' context; 'HiddenDependency' has been
imported as implementation-only

This should be improved further to support implicitly exported memory layouts in non-library-evolution and embedded.

@xymus
Copy link
Contributor Author

xymus commented Oct 21, 2025

@swift-ci Please smoke test

"in a public or '@usableFromInline' conformance|"
"in an '@available' attribute here}1; "
"in an '@available' attribute here|"
"in a variable declaration marked public or in a '@frozen' or '@usableFromInline' context}1; "
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we typically refer to these as properties in diagnostics, since it's not a local variable

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah right, I've updated it.

Replace the `here` part of the generic exportability diagnostic for
variables with: `in a property declaration marked public or in a
'@Frozen' or '@usableFromInline' context`.

The full diagnostic now looks like:
```
error: cannot use struct 'ImportedType' in a property declaration marked
public or in a '@Frozen' or '@usableFromInline' context;
'HiddenDependency' has been imported as implementation-only
```

This should be improved further to support implicitly exported memory
layouts in non-library-evolution and embedded.
@xymus xymus force-pushed the exportability-var-diag branch from 3904e5e to 2d339c1 Compare October 21, 2025 18:32
@xymus
Copy link
Contributor Author

xymus commented Oct 21, 2025

@swift-ci Please smoke test

@xymus xymus merged commit 4c9a9ca into swiftlang:main Oct 22, 2025
3 checks passed
@xymus xymus deleted the exportability-var-diag branch October 22, 2025 17:01
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.

3 participants