I'm getting the following error while compiling a generic class. Can anyone tell me what I'm doing wrong?
SIL verification failed: non-generic function definitions cannot have context archetypes: !FTy->isPolymorphic()
In function:
/
sil shared [transparent] [thunk] @_TTRGRq_8RealmKit18IdentifiableStruct_XFo_dV10ObjectiveC8ObjCBool_dT__XFo_dSb_dT__ : $@convention(thin) <τ_0_0 where τ_0_0 : IdentifiableStruct> (Bool, @owned @callee_owned (ObjCBool) -> ()) -> () {
bb0(%0 : $Bool, %1 : $@callee_owned (ObjCBool) -> ()):
/
%2 = function_ref @_TF10ObjectiveC22_convertBoolToObjCBoolFSbVS_8ObjCBool : $@convention(thin) (Bool) -> ObjCBool /
%3 = apply %2(%0) : $@convention(thin) (Bool) -> ObjCBool /
%4 = apply %1(%3) : $@callee_owned (ObjCBool) -> () /
return %4 : $() /
}
0 swift 0x0000000107ae3e0b llvm::sys::PrintStackTrace(__sFILE*) + 43
1 swift 0x0000000107ae454b SignalHandler(int) + 379
2 libsystem_platform.dylib 0x00007fff93ae3f1a _sigtramp + 26
3 libsystem_platform.dylib 0x0000000000000005 _sigtramp + 1817297157
4 swift 0x0000000107ae4346 abort + 22
5 swift 0x0000000105cb4c49 (anonymous namespace)::SILVerifier::_require(bool, llvm::Twine const&, std::__1::function<void ()> const&) + 425
6 swift 0x0000000105cb15e8 swift::SILFunction::verify() const + 392
7 swift 0x0000000105cb4124 swift::SILModule::verify() const + 164
8 swift 0x0000000105cee730 swift::Lowering::SILGenModule::~SILGenModule() + 32
9 swift 0x0000000105cf414b swift::SILModule::constructSIL(swift::ModuleDecl*, swift::SILOptions&, swift::FileUnit*, llvm::Optional<unsigned int>, bool, bool) + 923
10 swift 0x0000000105cf428b swift::performSILGeneration(swift::FileUnit&, swift::SILOptions&, llvm::Optional<unsigned int>, bool) + 123
11 swift 0x0000000105afd691 performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&) + 9153
12 swift 0x0000000105afb0b3 frontend_main(llvm::ArrayRef<char const*>, char const*, void*) + 2515
13 swift 0x0000000105af728f main + 1983
14 libdyld.dylib 0x00007fff8ea455c9 start + 1
15 libdyld.dylib 0x0000000000000051 start + 1901832841