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
[SR-8243] Assertion failed: (archetype->requiresClass() && "don't know what to do") #50775
Comments
cc @rjmccall, aschwaighofer@apple.com (JIRA User), @slavapestov. Anything we can do without the full project? |
The full project for this is the Twitch iOS app. I'm skeptical that I could get approval to give that to anyone outside the company. Let me know if there's any information I can pull from the project though. |
I think we are going to need more code than shown. The failing function is an re-abstraction thunk from native Swift closures to blocks. reabstraction thunk helper <A, B><A1, B1 where A1: AnyObject, B1: AnyObject> from
@escaping @callee_guaranteed (
@guaranteed @escaping @callee_guaranteed (
@guaranteed @escaping @callee_guaranteed (@guaranteed TwitchKit.(ObjcBox in _DA7F7CEE4B414290E144F07A4CB20784)<A>) -> (),
@guaranteed @escaping @callee_guaranteed (@guaranteed TwitchKit.(ObjcBox in _DA7F7CEE4B414290E144F07A4CB20784)<B>) -> ()
) -> ()
) -> ()
to
@escaping @callee_unowned @convention(block) (
@unowned @escaping @callee_unowned @convention(block) (
@unowned @escaping @callee_unowned @convention(block) (@unowned TwitchKit.(ObjcBox in _DA7F7CEE4B414290E144F07A4CB20784)<A>) -> (),
@unowned @escaping @callee_unowned @convention(block) (@unowned TwitchKit.(ObjcBox in _DA7F7CEE4B414290E144F07A4CB20784)<B>) -> ()
) -> ()
) -> () This would be similar to the closure shown above but AFAICT the innermost closures would look something like: |
I'll take a look. As a workaround, you can disable reflection metadata emission. |
I think I see what the problem is. |
Ok I think the error comes from this particular bit of code: private init<ObjcValue, ObjcError>(_bridging future: TWFuture<ObjcValue, ObjcError>, resultMapper: TWResultMapper<ObjcBox<Value>, ObjcBox<Error>, ObjcValue, ObjcError>) {
self.init(on: .immediate, { (resolver) in
let completion = resultMapper.flatMapFuture(future, onCancel: {
resolver.cancel()
}).onComplete({ (resultSwitchBlock) in
resultSwitchBlock({ (value) in
resolver.fulfill(with: value.value)
}, { (error) in
resolver.reject(with: error.value)
})
})
resolver.onRequestCancel(on: .main, { (_) in
completion.cancel()
})
})
} based on the fact that |
Does ObjectBox conform to _ObjectiveCBridgeable? |
@slavapestov No it does not. The declaration of |
I finally found a way to reproduce the issue.
|
I have a very similar problem internally as rdar://22470076 (yes, that's from 2015). |
For some reason we're not hitting this crash anymore with the version of the compiler in Xcode Beta 5. |
Kevin's original submission indicated he was testing a developer toolchain, which has asserts enabled. I'm not seeing a compile-time crash in a release build either. |
Ah, that makes sense. We were using a developer toolchain because of other crashes that were fixed in the nightlies but not yet in the swiftc bundled in Xcode. |
Environment
Xcode 10.0 (10L201y)
Swift 4.2 Snapshot 2018-07-11 (a)
Apple Swift version 4.2-dev (LLVM da1c9a3ae4, Clang a0e59b03e6, Swift 104c96a)
Additional Detail from JIRA
md5: a7390e0f869f33ea3d0d0d423849ddb6
Issue Description:
The current Swift 4.2 toolchain crashes on my code with the following stack trace:
This occurs when emitting the IR SIL function
@$S9TwitchKit7ObjcBox33_DA7F7CEE4B414290E144F07A4CB20784LLCyxGIegg_ADyq_GIegg_Ieggg_Iegg_AEIeyBy_AFIeyBy_IeyByy_IeyBy_Rld__CRld_0_Cr0_0_lTR
.That symbol looks a bit odd, I don't know why there are so many layers of function there. The
ObjcBox
class just looks likeand it's just used as a wrapper for arbitrary Swift types so they can be passed to Obj-C generics. Usage looks like
This code compiles just fine with Xcode 9.4.
The text was updated successfully, but these errors were encountered: