Open swift-ci opened 7 years ago
Assertion failed: (metadata && "extended objc class doesn't have constant metadata?"), function emitCategory, file /Volumes/Data/swift-public/swift/lib/IRGen/GenClass.cpp, line 1115.
Stack dump:
0. Program arguments: /Volumes/Data/swift-public/build/ninja/swift-macosx-x86_64/bin/swift -frontend -interpret - -target x86_64-apple-macosx10.12 -enable-objc-interop -sdk /Volumes/Data/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk -color-diagnostics -module-name main
1. While emitting IR for source file <stdin>
@slavapestov, @jckarter, one of you had another like this, right?
Yeah, we don't support extensions of generic subclasses of @objc classes. We have to emit the category in the same way we do in JIT mode, where we add it dynamically to runtime instead of emitting a static metadata record for it.
Smaller example:
import Foundation
protocol SomeProtocol {}
@objc protocol SomeObjCProto {}
class Foo<Bar: SomeProtocol>: NSObject { }
extension Foo: SomeObjCProto { }
We should consider rejecting this in Sema for now.
Attachment: Download
Additional Detail from JIRA
| | | |------------------|-----------------| |Votes | 0 | |Component/s | Compiler | |Labels | Bug, CompilerCrash | |Assignee | @slavapestov | |Priority | Medium | md5: 8ebb4ebdb785ef8c6369a8f2de8d11d3is duplicated by:
Issue Description:
The following code causes the compiler to crash (crash log is in the attachment):
The following code compiles: