-
Notifications
You must be signed in to change notification settings - Fork 10.4k
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
Runtime crash when calling functions with opaque return types, stored as closures #69057
Labels
assertion failure
Bug → crash: An assertion failure
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
compiler
The Swift compiler itself
crash
Bug: A crash, i.e., an abnormal termination of software
function types
Feature → types: function types
generics
Feature: generic declarations and types
implicit conversions
Feature: implicit conversions
opaque result types
Feature → types → opaque types: opaque result types
opaque types
Feature → types: opaque types
SILGen
Area → compiler: The SIL generation stage
swift 6.0
types
Feature: types
Comments
cristik
added
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
triage needed
This issue needs more specific labels
labels
Oct 9, 2023
assign me |
@AnthonyLatsis I am still seeing this same crash from |
AnthonyLatsis
added
compiler
The Swift compiler itself
SILGen
Area → compiler: The SIL generation stage
opaque types
Feature → types: opaque types
crash
Bug: A crash, i.e., an abnormal termination of software
function types
Feature → types: function types
opaque result types
Feature → types → opaque types: opaque result types
implicit conversions
Feature: implicit conversions
types
Feature: types
assertion failure
Bug → crash: An assertion failure
swift 6.0
generics
Feature: generic declarations and types
and removed
triage needed
This issue needs more specific labels
labels
Jul 12, 2024
This crashes at compile time with quite a recent dev compiler. Here is a reduction and a stack trace: protocol P {}
struct S: P {}
func foo(_: Int) -> S { S() }
let test: (Int) -> some P = foo
|
@AnthonyLatsis Ahh… interesting! Thanks! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
assertion failure
Bug → crash: An assertion failure
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
compiler
The Swift compiler itself
crash
Bug: A crash, i.e., an abnormal termination of software
function types
Feature → types: function types
generics
Feature: generic declarations and types
implicit conversions
Feature: implicit conversions
opaque result types
Feature → types → opaque types: opaque result types
opaque types
Feature → types: opaque types
SILGen
Area → compiler: The SIL generation stage
swift 6.0
types
Feature: types
Description
The following code crashes at runtime:
It crashes when calling workerFactory with
The address from the crash message is influenced by the value of the parameter passed to
workerFactory
, for exampleworkerFactory(4)
will crash with address 0x4.If I change the parameter type to
[Int]
(or any kind of array), the code no longer crashes, however as soon as I add another Int/Double/String/etc parameter it will again crash, but if I add a second array parameter it will not crash.I think this is a compiler bug, but unsure where the bug is:
some
keyword)Steps to reproduce
Run the above code snippet.
Expected behavior
Either it should not crash, or the compiler should now allow using
some
in this scenario.Environment
The text was updated successfully, but these errors were encountered: