Closed stevenkramer closed 5 years ago
have you tried swift42 branch?
Yes, was using that since dadb688
on previous betas. This started to manifest itself around beta 4.
Happened trying to auto-wire an optional initializer argument.
ah, I didn't notice that you opened this for this branch, my bad
FYI, i experience runtime crash with swift 4.2 and here is swift forums thread on roots of issue https://forums.swift.org/t/conditional-casting-with-any-as-type-parameter/16163
@stevenkramer can you add a test that is failing without this change?
@ilyapuchka done
This is not related to Swift 4.2, it also happens with Swift 4. It's due to reusing previously resolved instances - if the order of resolves is different in your test it works, but it can't reuse instances resolved for optional type. It also only happens for structs, not classes.
In Xcode 10 beta 5, the unboxing of optional values started to fail, because the code simultaneously tried to test for an empty optional and a successful cast. Breaking this up in two steps fixes the issue.