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

Applying @_transparent to a non-public non-@usableFromInline function crashes swift-frontend in release mode #59790

Open
b8591340 opened this issue Jun 29, 2022 · 2 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior.

Comments

@b8591340
Copy link

Note that this does not occur in new projects and packages, where the compilers correctly fails with the error.

It happened multiple times in a complex private package until I added @usableFromInline or public. The curious thing is that it built in debug mode for quite a while before I realized.

@b8591340 b8591340 added the bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. label Jun 29, 2022
@b8591340 b8591340 changed the title Applying @_transparent to a non-public non-@usableFromInline function crashes the compiler in release mode Applying @_transparent to a non-public non-@usableFromInline function crashes swift-frontend in release mode Jun 29, 2022
@slavapestov
Copy link
Contributor

Do you have a test case? Note that @_transparent is really only intended for use by the standard library. You should use @inlinable instead.

@b8591340
Copy link
Author

b8591340 commented Jul 2, 2022

I don’t Slava—can’t share the package, sorry.

I see. I think I ended up moving to @_transparent once I realized it was compiled once and then incremental builds did not affect @_transparent function bodies even when changed.

Is it correct that it only affects the first debug build in compile times? Otherwise, if I may, what’s best for telling the compiler to always inline in release builds while retaining the highest possible debug build performance? Anecdotally @inlinable @inline(__always) seems to increase debug build times.

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

No branches or pull requests

2 participants