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-7308] Seg Fault: While emitting IR SIL function #49856
Comments
Current commit on that repo: rexmas/Crust@5f76fc8 |
Reproduced. The function in question looks like this:
and, uh, that constraint that takes another generic parameter has probably never worked. Still, that should at least be caught at compile time if we can't implement it… cc @huonw @swift-ci create |
Comment by Rex Fenley (JIRA) refactoring like so has the same result public func <- <T, M, K>(field: inout T, binding:(key: Binding<K, M>, payload: MappingPayload<K>)) -> MappingPayload<K> where M.MappedObject == T { what approach should I use to fix this in the repo so I can unblock clients? |
Gotta ask: does it still crash on that function, or did that change move it to the next function in the file? |
Comment by Rex Fenley (JIRA) First crash While emitting IR SIL function "@_T05Crust2lsoiq1_xz_AA7BindingOyq0_q_G3key_q1_7payloadtt12MappedObjectQy_RszAA7MappingR_AA0H3KeyR0_AA0H7PayloadCyq0_GRb1_r2_lF".
for '<-(_:_:)' at /Users/Rex/Documents/projects/Crust/Crust/Mapper/MappingOperator.swift:80:8 Second crash after change and clean build While emitting IR SIL function "@_T05Crust2lsoiAA14MappingPayloadCyq0_Gxz_AA7BindingOyq0_q_G3key_AE7payloadtt12MappedObjectQy_RszAA0C0R_AA0C3KeyR0_r1_lF".
for '<-(_:_:)' at /Users/Rex/Documents/projects/Crust/Crust/Mapper/MappingOperator.swift:80:8 Line numbers are the same. |
Okay, so that's a red herring. Thanks! |
Comment by Rex Fenley (JIRA) No problem, thanks for replying quickly! Do you know if there is a work around we can use? |
It looks as if this is resolved on master: both a recent build of the master branch, and the older 2018-04-04 development snapshot successfully compiles the whole library! However, that doesn't solve the immediate problem of using it in Xcode 9.3. It looks like the problem here is an interaction between the For instance, public func <- <T, M, K, MC: MappingPayload<K>>(field: inout T, binding:(key: Binding<K, M>, payload: MC)) -> MC where M.MappedObject == T { ... }
// change to
public func <- <M, K, MC: MappingPayload<K>>(field: inout M.MappedObject, binding:(key: Binding<K, M>, payload: MC)) -> MC { ... }
// and
public func <- <T, M, K, MC: MappingPayload<K>, RRC: RangeReplaceableCollection>(field: inout RRC, binding:(key: Binding<K, M>, payload: MC)) -> MC where M.MappedObject == T, RRC.Iterator.Element == M.MappedObject {
// change to
public func <- <M, K, MC: MappingPayload<K>, RRC: RangeReplaceableCollection>(field: inout RRC, binding:(key: Binding<K, M>, payload: MC)) -> MC where RRC.Iterator.Element == M.MappedObject The same applies when there's protocol requirements: public func <- <T, M, K, MC: MappingPayload<K>, RRC: RangeReplaceableCollection>(field: inout RRC?, binding:(key: Binding<K, M>, payload: MC)) -> MC where M.MappedObject == T, RRC.Iterator.Element == M.MappedObject, T: Equatable {
// change to
public func <- <M, K, MC: MappingPayload<K>, RRC: RangeReplaceableCollection>(field: inout RRC?, binding:(key: Binding<K, M>, payload: MC)) -> MC where M.MappedObject: Equatable, RRC.Iterator.Element == M.MappedObject { Finally, there's two functions (around line 100 of MappingOperator.swift) that have a seemingly unused public func <- <T: JSONable, TF: Transform, K, MC: MappingPayload<K>>(field: inout T, binding:(key: Binding<K, TF>, payload: MC)) -> MC where TF.MappedObject == T, T == T.ConversionType
// change to
public func <- <TF, K, MC: MappingPayload<K>>(field: inout TF.MappedObject, binding:(key: Binding<K, TF>, payload: MC)) -> MC where TF.MappedObject: JSONable, TF.MappedObject == TF.MappedObject.ConversionType { The original code should work, and it's definitely sometimes clearer to be able to use a short generic parameter > that constraint that takes another generic parameter has probably never worked I think it should be okay: |
@belkadan superclass constraints where the superclass references another generic parameter (eg, |
Comment by Rex Fenley (JIRA) @huonw Thanks for the help. It got me pretty far but now I'm crashing here on Xcode 9.3 https://github.com/rexmas/Crust/blob/swift-4.1/RealmCrustTests/RealmMappings.swift#L268 You'll need to checkout `swift-4.1` branch and build the tests to see this file compile and the crash. However, this still blocks us. We don't distribute this file with the Pod since it's dependent on Realm, which would thus require a client to include all of Realm (which they may not use) with Crust. However, our team does copy this source file directly into our own project since we personally do use Realm. In other words, we're still blocked on moving to 9.3 until the test files can all compile too. |
Ah! I'd missed the tests completely, sorry. Unfortunately that does look like the solution I mentioned above doesn't fix that problem, so there's something more fundamental going on here. |
Using a swift 4.1 snapshot with assertions on, we get a more descriptive assertion failure message for the original crash: Assertion failed: (!archetype->isPrimary() && "type metadata for primary archetype was not bound in context"), function emitArchetypeTypeMetadataRef, file /Users/buildnode/jenkins/workspace/oss-swift-4.1-package-osx/swift/lib/IRGen/GenArchetype.cpp, line 64.
0 swift 0x000000010f84b498 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 40
1 swift 0x000000010f84bba6 SignalHandler(int) + 694
2 libsystem_platform.dylib 0x00007fff5b0def5a _sigtramp + 26
3 libdyld.dylib 0x00007fff5add0149 dyldGlobalLockRelease() + 0
4 libsystem_c.dylib 0x00007fff5ae7c1ae abort + 127
5 libsystem_c.dylib 0x00007fff5ae441ac basename_r + 0
6 swift 0x000000010c349e76 swift::irgen::emitArchetypeTypeMetadataRef(swift::irgen::IRGenFunction&, swift::CanTypeWrapper<swift::ArchetypeType>) + 182
7 swift 0x000000010c3fea5a llvm::Value* swift::CanTypeVisitor<(anonymous namespace)::EmitTypeMetadataRef, llvm::Value*>::visit<>(swift::CanType) + 778
8 swift 0x000000010c3f09c0 swift::irgen::IRGenFunction::emitTypeMetadataRef(swift::CanType) + 96
9 swift 0x000000010c400c1e void llvm::function_ref<void (unsigned int, swift::CanType, llvm::Optional<swift::ProtocolConformanceRef>)>::callback_fn<(anonymous namespace)::GenericArguments::collect(swift::irgen::IRGenFunction&, swift::CanType)::'lambda'(unsigned int, swift::CanType, llvm::Optional<swift::ProtocolConformanceRef>)>(long, unsigned int, swift::CanType, llvm::Optional<swift::ProtocolConformanceRef>) + 78
10 swift 0x000000010c41d0e5 swift::irgen::GenericTypeRequirements::enumerateFulfillments(swift::irgen::IRGenModule&, swift::SubstitutionMap const&, llvm::function_ref<void (unsigned int, swift::CanType, llvm::Optional<swift::ProtocolConformanceRef>)>) + 261
11 swift 0x000000010c40081c emitNominalMetadataRef(swift::irgen::IRGenFunction&, swift::NominalTypeDecl*, swift::CanType) + 348
12 swift 0x000000010c3fe8a6 llvm::Value* swift::CanTypeVisitor<(anonymous namespace)::EmitTypeMetadataRef, llvm::Value*>::visit<>(swift::CanType) + 342
13 swift 0x000000010c3f09c0 swift::irgen::IRGenFunction::emitTypeMetadataRef(swift::CanType) + 96
14 swift 0x000000010c3f0d65 llvm::Value* swift::CanTypeVisitor<(anonymous namespace)::EmitTypeMetadataRefForLayout, llvm::Value*>::visit<>(swift::CanType) + 85
15 swift 0x000000010c3f118f llvm::Value* swift::CanTypeVisitor<(anonymous namespace)::EmitTypeMetadataRefForLayout, llvm::Value*>::visit<>(swift::CanType) + 1151
16 swift 0x000000010c3f1207 llvm::Value* swift::CanTypeVisitor<(anonymous namespace)::EmitTypeMetadataRefForLayout, llvm::Value*>::visit<>(swift::CanType) + 1271
17 swift 0x000000010c3f0cde swift::irgen::IRGenFunction::emitTypeMetadataRefForLayout(swift::SILType) + 46
18 swift 0x000000010c43fea9 (anonymous namespace)::TupleNonFixedOffsets::getOffsetForIndex(swift::irgen::IRGenFunction&, unsigned int) + 25
19 swift 0x000000010c4b650d swift::irgen::ElementLayout::project(swift::irgen::IRGenFunction&, swift::irgen::Address, llvm::Optional<swift::irgen::NonFixedOffsetsImpl*>, llvm::Twine const&) const + 141
20 swift 0x000000010c43ed8b swift::irgen::RecordTypeInfoImpl<(anonymous namespace)::NonFixedTupleTypeInfo, swift::irgen::WitnessSizedTypeInfo<(anonymous namespace)::NonFixedTupleTypeInfo>, (anonymous namespace)::TupleFieldInfo, false>::initializeWithTake(swift::irgen::IRGenFunction&, swift::irgen::Address, swift::irgen::Address, swift::SILType, bool) const + 747
21 swift 0x000000010c3b49ff (anonymous namespace)::MultiPayloadEnumImplStrategy::emitIndirectInitialize(swift::irgen::IRGenFunction&, swift::irgen::Address, swift::irgen::Address, swift::SILType, swift::IsTake_t, bool) const + 1279
22 swift 0x000000010c3ae78a (anonymous namespace)::MultiPayloadEnumImplStrategy::initializeWithTake(swift::irgen::IRGenFunction&, swift::irgen::Address, swift::irgen::Address, swift::SILType, bool) const + 426
23 swift 0x000000010c39a71c void llvm::function_ref<void (swift::irgen::TypeInfo const&, swift::irgen::IRGenFunction&, swift::irgen::Address, swift::irgen::Address, swift::SILType)>::callback_fn<swift::irgen::IRGenModule::getOrCreateOutlinedInitializeWithTakeFunction(swift::irgen::TypeInfo const&, llvm::Type*, swift::SILType, llvm::MapVector<swift::CanType, llvm::Value*, llvm::DenseMap<swift::CanType, unsigned int, llvm::DenseMapInfo<swift::CanType>, llvm::detail::DenseMapPair<swift::CanType, unsigned int> >, std::__1::vector<std::__1::pair<swift::CanType, llvm::Value*>, std::__1::allocator<std::__1::pair<swift::CanType, llvm::Value*> > > > const*)::$_8>(long, swift::irgen::TypeInfo const&, swift::irgen::IRGenFunction&, swift::irgen::Address, swift::irgen::Address, swift::SILType) + 44
24 swift 0x000000010c39a67b void llvm::function_ref<void (swift::irgen::IRGenFunction&)>::callback_fn<swift::irgen::IRGenModule::getOrCreateOutlinedCopyAddrHelperFunction(swift::irgen::TypeInfo const&, llvm::Type*, swift::SILType, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, llvm::function_ref<void (swift::irgen::TypeInfo const&, swift::irgen::IRGenFunction&, swift::irgen::Address, swift::irgen::Address, swift::SILType)>, llvm::MapVector<swift::CanType, llvm::Value*, llvm::DenseMap<swift::CanType, unsigned int, llvm::DenseMapInfo<swift::CanType>, llvm::detail::DenseMapPair<swift::CanType, unsigned int> >, std::__1::vector<std::__1::pair<swift::CanType, llvm::Value*>, std::__1::allocator<std::__1::pair<swift::CanType, llvm::Value*> > > > const*)::$_7>(long, swift::irgen::IRGenFunction&) + 203
25 swift 0x000000010c3940d5 swift::irgen::IRGenModule::getOrCreateHelperFunction(llvm::StringRef, llvm::Type*, llvm::ArrayRef<llvm::Type*>, llvm::function_ref<void (swift::irgen::IRGenFunction&)>, bool) + 293
26 swift 0x000000010c3952ea swift::irgen::IRGenModule::getOrCreateOutlinedCopyAddrHelperFunction(swift::irgen::TypeInfo const&, llvm::Type*, swift::SILType, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, llvm::function_ref<void (swift::irgen::TypeInfo const&, swift::irgen::IRGenFunction&, swift::irgen::Address, swift::irgen::Address, swift::SILType)>, llvm::MapVector<swift::CanType, llvm::Value*, llvm::DenseMap<swift::CanType, unsigned int, llvm::DenseMapInfo<swift::CanType>, llvm::detail::DenseMapPair<swift::CanType, unsigned int> >, std::__1::vector<std::__1::pair<swift::CanType, llvm::Value*>, std::__1::allocator<std::__1::pair<swift::CanType, llvm::Value*> > > > const*) + 346
27 swift 0x000000010c39554a swift::irgen::IRGenModule::getOrCreateOutlinedInitializeWithTakeFunction(swift::irgen::TypeInfo const&, llvm::Type*, swift::SILType, llvm::MapVector<swift::CanType, llvm::Value*, llvm::DenseMap<swift::CanType, unsigned int, llvm::DenseMapInfo<swift::CanType>, llvm::detail::DenseMapPair<swift::CanType, unsigned int> >, std::__1::vector<std::__1::pair<swift::CanType, llvm::Value*>, std::__1::allocator<std::__1::pair<swift::CanType, llvm::Value*> > > > const*) + 570
28 swift 0x000000010c39484f swift::irgen::IRGenModule::generateCallToOutlinedCopyAddr(swift::irgen::IRGenFunction&, swift::irgen::TypeInfo const&, swift::irgen::Address, swift::irgen::Address, swift::SILType, llvm::Constant* (swift::irgen::IRGenModule::*)(swift::irgen::TypeInfo const&, llvm::Type*, swift::SILType, llvm::MapVector<swift::CanType, llvm::Value*, llvm::DenseMap<swift::CanType, unsigned int, llvm::DenseMapInfo<swift::CanType>, llvm::detail::DenseMapPair<swift::CanType, unsigned int> >, std::__1::vector<std::__1::pair<swift::CanType, llvm::Value*>, std::__1::allocator<std::__1::pair<swift::CanType, llvm::Value*> > > > const*), llvm::MapVector<swift::CanType, llvm::Value*, llvm::DenseMap<swift::CanType, unsigned int, llvm::DenseMapInfo<swift::CanType>, llvm::detail::DenseMapPair<swift::CanType, unsigned int> >, std::__1::vector<std::__1::pair<swift::CanType, llvm::Value*>, std::__1::allocator<std::__1::pair<swift::CanType, llvm::Value*> > > > const*) + 287
29 swift 0x000000010c3ae71b (anonymous namespace)::MultiPayloadEnumImplStrategy::initializeWithTake(swift::irgen::IRGenFunction&, swift::irgen::Address, swift::irgen::Address, swift::SILType, bool) const + 315
30 swift 0x000000010c48aeb1 swift::SILInstructionVisitor<(anonymous namespace)::IRGenSILFunction, void>::visit(swift::SILInstruction*) + 37041
31 swift 0x000000010c47e47f (anonymous namespace)::IRGenSILFunction::emitSILFunction() + 7151
32 swift 0x000000010c47c3a1 swift::irgen::IRGenModule::emitSILFunction(swift::SILFunction*) + 1361
33 swift 0x000000010c38b585 swift::irgen::IRGenerator::emitGlobalTopLevel() + 485
34 swift 0x000000010c458d04 performIRGeneration(swift::IRGenOptions&, swift::ModuleDecl*, std::__1::unique_ptr<swift::SILModule, std::__1::default_delete<swift::SILModule> >, llvm::StringRef, llvm::LLVMContext&, swift::SourceFile*, llvm::GlobalVariable**, unsigned int) + 1124
35 swift 0x000000010c459396 swift::performIRGeneration(swift::IRGenOptions&, swift::SourceFile&, std::__1::unique_ptr<swift::SILModule, std::__1::default_delete<swift::SILModule> >, llvm::StringRef, llvm::LLVMContext&, unsigned int, llvm::GlobalVariable**) + 86
36 swift 0x000000010c3022ba performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*, swift::UnifiedStatsReporter*) + 13786
37 swift 0x000000010c2fdcf0 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 3376
38 swift 0x000000010c2bd5a3 main + 3075
39 libdyld.dylib 0x00007fff5add0015 start + 1
40 libdyld.dylib 0x0000000000000054 start + 2770534464
Stack dump:
0. Program arguments: /Library/Developer/Toolchains/swift-4.1-DEVELOPMENT-SNAPSHOT-2018-03-28-a.xctoolchain/usr/bin/swift -frontend -c /Users/jgroff/src/Crust/Crust/Mapper/MappingKey.swift /Users/jgroff/src/Crust/Crust/Mapper/Mapper.swift -primary-file /Users/jgroff/src/Crust/Crust/Mapper/MappingOperator.swift /Users/jgroff/src/Crust/Crust/Mapper/MappingProtocols.swift /Users/jgroff/src/Crust/Crust/Utilities/Utilities.swift /Users/jgroff/src/Crust/Crust/Utilities/AnyAdapter.swift -target x86_64-apple-ios8.0 -enable-objc-interop -sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.3.sdk -I /Users/jgroff/Library/Developer/Xcode/DerivedData/Crust-ajwdfzcatvzzfdfhqnedyxqusudn/Build/Products/Debug-iphonesimulator -F /Users/jgroff/Library/Developer/Xcode/DerivedData/Crust-ajwdfzcatvzzfdfhqnedyxqusudn/Build/Products/Debug-iphonesimulator -F /Users/jgroff/Library/Developer/Xcode/DerivedData/Crust-ajwdfzcatvzzfdfhqnedyxqusudn/Build/Products/Debug-iphonesimulator/JSONValueRX -enable-testing -g -import-underlying-module -module-cache-path /Users/jgroff/Library/Developer/Xcode/DerivedData/ModuleCache.noindex -swift-version 4 -enforce-exclusivity=checked -Onone -D COCOAPODS -serialize-debugging-options -Xcc -I/Users/jgroff/Library/Developer/Xcode/DerivedData/Crust-ajwdfzcatvzzfdfhqnedyxqusudn/Build/Intermediates.noindex/Crust.build/Debug-iphonesimulator/Crust.build/swift-overrides.hmap -Xcc -iquote -Xcc /Users/jgroff/Library/Developer/Xcode/DerivedData/Crust-ajwdfzcatvzzfdfhqnedyxqusudn/Build/Intermediates.noindex/Crust.build/Debug-iphonesimulator/Crust.build/Crust-generated-files.hmap -Xcc -I/Users/jgroff/Library/Developer/Xcode/DerivedData/Crust-ajwdfzcatvzzfdfhqnedyxqusudn/Build/Intermediates.noindex/Crust.build/Debug-iphonesimulator/Crust.build/Crust-own-target-headers.hmap -Xcc -I/Users/jgroff/Library/Developer/Xcode/DerivedData/Crust-ajwdfzcatvzzfdfhqnedyxqusudn/Build/Intermediates.noindex/Crust.build/Debug-iphonesimulator/Crust.build/Crust-all-non-framework-target-headers.hmap -Xcc -ivfsoverlay -Xcc /Users/jgroff/Library/Developer/Xcode/DerivedData/Crust-ajwdfzcatvzzfdfhqnedyxqusudn/Build/Intermediates.noindex/Crust.build/all-product-headers.yaml -Xcc -iquote -Xcc /Users/jgroff/Library/Developer/Xcode/DerivedData/Crust-ajwdfzcatvzzfdfhqnedyxqusudn/Build/Intermediates.noindex/Crust.build/Debug-iphonesimulator/Crust.build/Crust-project-headers.hmap -Xcc -I/Users/jgroff/Library/Developer/Xcode/DerivedData/Crust-ajwdfzcatvzzfdfhqnedyxqusudn/Build/Products/Debug-iphonesimulator/include -Xcc -I/Users/jgroff/Library/Developer/Xcode/DerivedData/Crust-ajwdfzcatvzzfdfhqnedyxqusudn/Build/Intermediates.noindex/Crust.build/Debug-iphonesimulator/Crust.build/DerivedSources/x86_64 -Xcc -I/Users/jgroff/Library/Developer/Xcode/DerivedData/Crust-ajwdfzcatvzzfdfhqnedyxqusudn/Build/Intermediates.noindex/Crust.build/Debug-iphonesimulator/Crust.build/DerivedSources -Xcc -DDEBUG=1 -Xcc -DCOCOAPODS=1 -Xcc -ivfsoverlay -Xcc /Users/jgroff/Library/Developer/Xcode/DerivedData/Crust-ajwdfzcatvzzfdfhqnedyxqusudn/Build/Intermediates.noindex/Crust.build/Debug-iphonesimulator/Crust.build/unextended-module-overlay.yaml -Xcc -working-directory/Users/jgroff/src/Crust -emit-module-doc-path /Users/jgroff/Library/Developer/Xcode/DerivedData/Crust-ajwdfzcatvzzfdfhqnedyxqusudn/Build/Intermediates.noindex/Crust.build/Debug-iphonesimulator/Crust.build/Objects-normal/x86_64/MappingOperator~partial.swiftdoc -serialize-diagnostics-path /Users/jgroff/Library/Developer/Xcode/DerivedData/Crust-ajwdfzcatvzzfdfhqnedyxqusudn/Build/Intermediates.noindex/Crust.build/Debug-iphonesimulator/Crust.build/Objects-normal/x86_64/MappingOperator.dia -module-name Crust -emit-module-path /Users/jgroff/Library/Developer/Xcode/DerivedData/Crust-ajwdfzcatvzzfdfhqnedyxqusudn/Build/Intermediates.noindex/Crust.build/Debug-iphonesimulator/Crust.build/Objects-normal/x86_64/MappingOperator~partial.swiftmodule -emit-dependencies-path /Users/jgroff/Library/Developer/Xcode/DerivedData/Crust-ajwdfzcatvzzfdfhqnedyxqusudn/Build/Intermediates.noindex/Crust.build/Debug-iphonesimulator/Crust.build/Objects-normal/x86_64/MappingOperator.d -emit-reference-dependencies-path /Users/jgroff/Library/Developer/Xcode/DerivedData/Crust-ajwdfzcatvzzfdfhqnedyxqusudn/Build/Intermediates.noindex/Crust.build/Debug-iphonesimulator/Crust.build/Objects-normal/x86_64/MappingOperator.swiftdeps -o /Users/jgroff/Library/Developer/Xcode/DerivedData/Crust-ajwdfzcatvzzfdfhqnedyxqusudn/Build/Intermediates.noindex/Crust.build/Debug-iphonesimulator/Crust.build/Objects-normal/x86_64/MappingOperator.o -index-store-path /Users/jgroff/Library/Developer/Xcode/DerivedData/Crust-ajwdfzcatvzzfdfhqnedyxqusudn/Index/DataStore -index-system-modules
1. While emitting IR SIL function "@_T05Crust2lsoiq1_xz_AA7BindingOyq0_q_G3key_q1_7payloadtt12MappedObjectQy_RszAA7MappingR_AA0H3KeyR0_AA0H7PayloadCyq0_GRb1_r2_lF".
for '<-(_:_:)' at /Users/jgroff/src/Crust/Crust/Mapper/MappingOperator.swift:80:8 |
I can reproduce Huon's success with the master branch; I was able to both build |
@rjmccall made some major changes to the outlined value operation thunks on master, so its possible some bugs were fixed along the way. If we can add a regression test it would be great. |
I'd suspect the fix to be somewhere like in |
No, IIRC the issue was the the out-of-line operations had a visitor to collect substitutions from the generic type and they weren't visiting all the structural components of the type in all cases. |
I see. Since the problem is in the out-of-line copy/consume enum operations, it looks like you can work around the bug by making the --- a/Crust/Mapper/MappingProtocols.swift
+++ b/Crust/Mapper/MappingProtocols.swift
@@ -9,7 +9,7 @@ public enum CollectionInsertionMethod<Element> {
public typealias CollectionUpdatePolicy<Element> =
(insert: CollectionInsertionMethod<Element>, unique: Bool, nullable: Bool)
-public enum Binding<K: MappingKey, M: Mapping> {
+public indirect enum Binding<K: MappingKey, M: Mapping> {
case mapping(K, M)
case collectionMapping(K, M, CollectionUpdatePolicy<M.MappedObject>) You should be able to back out that change when the 4.2 or master branch ships, but for the meantime in Xcode 9.3 that should hopefully keep you going. Would you be able to submit the Crust project to our compatibility test suite at https://github.com/apple/swift-source-compat-suite ? |
Comment by Rex Fenley (JIRA) Amazing, that worked. I'd be happy to add it to the compatibility suite. It will take some rejiggering first to support SPM, but I'll set some time aside to make that happen. Thank you all for helping out! |
Thanks for following up, and for offering to contribute your project to the compatibility suite! |
Changing the state to "Closed" since it seems that Rex confirmed that the issue is fixed. |
Environment
Xcode 9.3
Swift 4.1
MacBook Pro
iOS Simulator
Additional Detail from JIRA
md5: 3ddb60c8a7ab99482c8525758d6b3590
Issue Description:
A project for mapping data from JSON to Realm that heavily relies on generics can no longer compile as of Xcode 9.3. This is preventing our team from updating to the latest Xcode since it's heavily used in our App.
You can clone it and try to build here
The text was updated successfully, but these errors were encountered: