My experience with Conditional Conformances

Hello, I’ve been working on Vapor 3 the last days and trying to run Vapor 3 in Swift 4.1 (the build bundled with the Xcode 9.3 beta). A lot of our code is breaking for Swift 4.1 because we relied on certain types being conformant to Encodable. To work around this we had to pull out quite ugly code, but then I looked at our ORM called Fluent.

Fluent relies really really heavily on KeyPaths and Codable, but due to conditional conformances a lot of scenarios weren’t technically correct (anymore). Scenarios that would previously crash are now properly handled, and that is a good thing overall, but would require Swift 4.0 users to basically have a different copy of the ORM using #if swift(>=4.1).

So we decided to move our framework to only support Swift 4.1 and above, which we’re able to do since we’re still in beta. However, at this point we get some really annoying crashes due to the complexity of our ORM.

This migration extension implements a default implementation for Models conforming to Migration. It does it’s job really well and has 2 really sensible requirements that match most scenarios.

At the same time in another module we’ve got:

extension Optional: KeyStringDecodable where Wrapped: KeyStringDecodable

And this is completely sensible and works… until you combine the two.

0  swift                    0x000000010d8b878a PrintStackTraceSignalHandler(void*) + 42
1  swift                    0x000000010d8b7b46 SignalHandler(int) + 966
2  libsystem_platform.dylib 0x00007fff70ebdf5a _sigtramp + 26
3  libsystem_platform.dylib 0x00007fd65eaaacd0 _sigtramp + 3988704656
4  swift                    0x000000010ad35560 (anonymous namespace)::SILTypeSubstituter::visitType(swift::CanType) + 128
5  swift                    0x000000010ad358e2 (anonymous namespace)::SILTypeSubstituter::substSILFunctionType(swift::CanTypeWrapper<swift::SILFunctionType>) + 754
6  swift                    0x000000010a9bf23e swift::ReabstractionInfo::ReabstractionInfo(swift::ApplySite, swift::SILFunction*, llvm::ArrayRef<swift::Substitution>, bool, swift::OptRemark::Emitter*) + 622
7  swift                    0x000000010abfee8a (anonymous namespace)::UsePrespecialized::run() + 826
8  swift                    0x000000010aa1bb79 swift::SILPassManager::runOneIteration() + 10217
9  swift                    0x0000000109f1e036 performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*, swift::UnifiedStatsReporter*) + 32038
10 swift                    0x0000000109f14894 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 7908
11 swift                    0x0000000109ec92c5 main + 18917
12 libdyld.dylib            0x00007fff70c3c115 start + 1
Stack dump:
1.	While running pass #0 SILModuleTransform "Use Pre-Specialized Functions".

Now I haven’t been involved with the compilers, but from my history with Swift the first assumption I’m making is that “this expression is too complex”.

I’m not sure if this is (easily) fixable… but in general I think putting out my experiences with the Conditional Conformances could help gain an understanding of use cases and problems involved, hopefully leading to a better compiler.

I truly love this feature, but it did make my week a lot more complex than I hoped/expected it to be.

Another example can be found here



*** DESERIALIZATION FAILURE (please include this section in any bug report) ***
serialized conformances do not match requirement signature
0  swift                    0x00000001058b578a PrintStackTraceSignalHandler(void*) + 42
1  swift                    0x00000001058b4b46 SignalHandler(int) + 966
2  libsystem_platform.dylib 0x00007fff70ebdf5a _sigtramp + 26
3  libsystem_platform.dylib 0x000000011609e558 _sigtramp + 2770208280
4  libsystem_c.dylib        0x00007fff70ce8312 abort + 127
5  swift                    0x0000000102fe99de swift::ModuleFile::fatal(llvm::Error) + 2062
6  swift                    0x0000000103005fcb swift::ModuleFile::finishNormalConformance(swift::NormalProtocolConformance*, unsigned long long) + 7403
7  swift                    0x0000000103311692 swift::NormalProtocolConformance::getTypeWitnessAndDecl(swift::AssociatedTypeDecl*, swift::LazyResolver*, swift::SubstOptions) const + 66
8  swift                    0x0000000103310f68 swift::ProtocolConformance::getTypeWitnessAndDecl(swift::AssociatedTypeDecl*, swift::LazyResolver*, swift::SubstOptions) const + 472
9  swift                    0x0000000103311103 swift::ProtocolConformance::getTypeWitnessAndDecl(swift::AssociatedTypeDecl*, swift::LazyResolver*, swift::SubstOptions) const + 883
10 swift                    0x0000000103326357 getMemberForBaseType(llvm::function_ref<llvm::Optional<swift::ProtocolConformanceRef> (swift::CanType, swift::Type, swift::ProtocolType*)>, swift::Type, swift::Type, swift::AssociatedTypeDecl*, swift::Identifier, swift::SubstOptions) + 1207
11 swift                    0x0000000103325bc8 llvm::Optional<swift::Type> llvm::function_ref<llvm::Optional<swift::Type> (swift::TypeBase*)>::callback_fn<substType(swift::Type, llvm::function_ref<swift::Type (swift::SubstitutableType*)>, llvm::function_ref<llvm::Optional<swift::ProtocolConformanceRef> (swift::CanType, swift::Type, swift::ProtocolType*)>, swift::SubstOptions)::$_18>(long, swift::TypeBase*) + 1400
12 swift                    0x000000010331ed59 swift::Type::transformRec(llvm::function_ref<llvm::Optional<swift::Type> (swift::TypeBase*)>) const + 137
13 swift                    0x0000000103324d83 substType(swift::Type, llvm::function_ref<swift::Type (swift::SubstitutableType*)>, llvm::function_ref<llvm::Optional<swift::ProtocolConformanceRef> (swift::CanType, swift::Type, swift::ProtocolType*)>, swift::SubstOptions) + 211
14 swift                    0x0000000103325a84 llvm::Optional<swift::Type> llvm::function_ref<llvm::Optional<swift::Type> (swift::TypeBase*)>::callback_fn<substType(swift::Type, llvm::function_ref<swift::Type (swift::SubstitutableType*)>, llvm::function_ref<llvm::Optional<swift::ProtocolConformanceRef> (swift::CanType, swift::Type, swift::ProtocolType*)>, swift::SubstOptions)::$_18>(long, swift::TypeBase*) + 1076
15 swift                    0x000000010331ed59 swift::Type::transformRec(llvm::function_ref<llvm::Optional<swift::Type> (swift::TypeBase*)>) const + 137
16 swift                    0x0000000103324d83 substType(swift::Type, llvm::function_ref<swift::Type (swift::SubstitutableType*)>, llvm::function_ref<llvm::Optional<swift::ProtocolConformanceRef> (swift::CanType, swift::Type, swift::ProtocolType*)>, swift::SubstOptions) + 211
17 swift                    0x0000000102d32539 (anonymous namespace)::SILTypeSubstituter::visitType(swift::CanType) + 89
18 swift                    0x0000000102d328e2 (anonymous namespace)::SILTypeSubstituter::substSILFunctionType(swift::CanTypeWrapper<swift::SILFunctionType>) + 754
19 swift                    0x0000000102d32de3 swift::SILFunctionType::substGenericArgs(swift::SILModule&, llvm::ArrayRef<swift::Substitution>) + 275
20 swift                    0x0000000102d49cc3 swift::TryApplyInst::create(swift::SILDebugLocation, swift::SILValue, llvm::ArrayRef<swift::Substitution>, llvm::ArrayRef<swift::SILValue>, swift::SILBasicBlock*, swift::SILBasicBlock*, swift::SILFunction&, swift::SILOpenedArchetypesState&, swift::GenericSpecializationInformation const*) + 67
21 swift                    0x000000010301a325 swift::SILDeserializer::readSILInstruction(swift::SILFunction*, swift::SILBasicBlock*, swift::SILBuilder&, unsigned int, llvm::SmallVectorImpl<unsigned long long>&) + 56517
22 swift                    0x000000010300be30 swift::SILDeserializer::readSILFunction(llvm::PointerEmbeddedInt<unsigned int, 31>, swift::SILFunction*, llvm::StringRef, bool, bool) + 5712
23 swift                    0x000000010301edad swift::SILDeserializer::getAllSILFunctions() + 893
24 swift                    0x00000001030b70a4 swift::SerializedSILLoader::getAllForModule(swift::Identifier, swift::FileUnit*) + 196
25 swift                    0x0000000101f1aa0b performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*, swift::UnifiedStatsReporter*) + 30459
26 swift                    0x0000000101f11894 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 7908
27 swift                    0x0000000101ec62c5 main + 18917
28 libdyld.dylib            0x00007fff70c3c115 start + 1
29 libdyld.dylib            0x0000000000000062 start + 2403090254
Stack dump:
0.	Program arguments: /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -merge-modules -emit-module /Users/joannisorlandos/Library/Developer/Xcode/DerivedData/Fluent-bfxtpijryoomwsgclfvoaxqqtfql/Build/Intermediates.noindex/Fluent.build/Debug/Fluent.build/Objects-normal/x86_64/FluentCache~partial.swiftmodule /Users/joannisorlandos/Library/Developer/Xcode/DerivedData/Fluent-bfxtpijryoomwsgclfvoaxqqtfql/Build/Intermediates.noindex/Fluent.build/Debug/Fluent.build/Objects-normal/x86_64/FluentCacheEntry~partial.swiftmodule /Users/joannisorlandos/Library/Developer/Xcode/DerivedData/Fluent-bfxtpijryoomwsgclfvoaxqqtfql/Build/Intermediates.noindex/Fluent.build/Debug/Fluent.build/Objects-normal/x86_64/FluentCacheMigration~partial.swiftmodule /Users/joannisorlandos/Library/Developer/Xcode/DerivedData/Fluent-bfxtpijryoomwsgclfvoaxqqtfql/Build/Intermediates.noindex/Fluent.build/Debug/Fluent.build/Objects-normal/x86_64/DatabaseConnection~partial.swiftmodule /Users/joannisorlandos/Library/Developer/Xcode/DerivedData/Fluent-bfxtpijryoomwsgclfvoaxqqtfql/Build/Intermediates.noindex/Fluent.build/Debug/Fluent.build/Objects-normal/x86_64/Exports~partial.swiftmodule /Users/joannisorlandos/Library/Developer/Xcode/DerivedData/Fluent-bfxtpijryoomwsgclfvoaxqqtfql/Build/Intermediates.noindex/Fluent.build/Debug/Fluent.build/Objects-normal/x86_64/FluentError~partial.swiftmodule /Users/joannisorlandos/Library/Developer/Xcode/DerivedData/Fluent-bfxtpijryoomwsgclfvoaxqqtfql/Build/Intermediates.noindex/Fluent.build/Debug/Fluent.build/Objects-normal/x86_64/Migration~partial.swiftmodule /Users/joannisorlandos/Library/Developer/Xcode/DerivedData/Fluent-bfxtpijryoomwsgclfvoaxqqtfql/Build/Intermediates.noindex/Fluent.build/Debug/Fluent.build/Objects-normal/x86_64/MigrationConfig~partial.swiftmodule /Users/joannisorlandos/Library/Developer/Xcode/DerivedData/Fluent-bfxtpijryoomwsgclfvoaxqqtfql/Build/Intermediates.noindex/Fluent.build/Debug/Fluent.build/Objects-normal/x86_64/MigrationContainer~partial.swiftmodule /Users/joannisorlandos/Library/Developer/Xcode/DerivedData/Fluent-bfxtpijryoomwsgclfvoaxqqtfql/Build/Intermediates.noindex/Fluent.build/Debug/Fluent.build/Objects-normal/x86_64/MigrationLog~partial.swiftmodule /Users/joannisorlandos/Library/Developer/Xcode/DerivedData/Fluent-bfxtpijryoomwsgclfvoaxqqtfql/Build/Intermediates.noindex/Fluent.build/Debug/Fluent.build/Objects-normal/x86_64/QueryMigrationConfig~partial.swiftmodule /Users/joannisorlandos/Library/Developer/Xcode/DerivedData/Fluent-bfxtpijryoomwsgclfvoaxqqtfql/Build/Intermediates.noindex/Fluent.build/Debug/Fluent.build/Objects-normal/x86_64/SchemaMigrationConfig~partial.swiftmodule /Users/joannisorlandos/Library/Developer/Xcode/DerivedData/Fluent-bfxtpijryoomwsgclfvoaxqqtfql/Build/Intermediates.noindex/Fluent.build/Debug/Fluent.build/Objects-normal/x86_64/Identifier~partial.swiftmodule /Users/joannisorlandos/Library/Developer/Xcode/DerivedData/Fluent-bfxtpijryoomwsgclfvoaxqqtfql/Build/Intermediates.noindex/Fluent.build/Debug/Fluent.build/Objects-normal/x86_64/Model~partial.swiftmodule /Users/joannisorlandos/Library/Developer/Xcode/DerivedData/Fluent-bfxtpijryoomwsgclfvoaxqqtfql/Build/Intermediates.noindex/Fluent.build/Debug/Fluent.build/Objects-normal/x86_64/SoftDeletable~partial.swiftmodule /Users/joannisorlandos/Library/Developer/Xcode/DerivedData/Fluent-bfxtpijryoomwsgclfvoaxqqtfql/Build/Intermediates.noindex/Fluent.build/Debug/Fluent.build/Objects-normal/x86_64/Timestampable~partial.swiftmodule /Users/joannisorlandos/Library/Developer/Xcode/DerivedData/Fluent-bfxtpijryoomwsgclfvoaxqqtfql/Build/Intermediates.noindex/Fluent.build/Debug/Fluent.build/Objects-normal/x86_64/Pivot~partial.swiftmodule /Users/joannisorlandos/Library/Developer/Xcode/DerivedData/Fluent-bfxtpijryoomwsgclfvoaxqqtfql/Build/Intermediates.noindex/Fluent.build/Debug/Fluent.build/Objects-normal/x86_64/QueryBuilder+CRUD~partial.swiftmodule /Users/joannisorlandos/Library/Developer/Xcode/DerivedData/Fluent-bfxtpijryoomwsgclfvoaxqqtfql/Build/Intermediates.noindex/Fluent.build/Debug/Fluent.build/Objects-normal/x86_64/QueryBuilder+Execute~partial.swiftmodule /Users/joannisorlandos/Library/Developer/Xcode/DerivedData/Fluent-bfxtpijryoomwsgclfvoaxqqtfql/Build/Intermediates.noindex/Fluent.build/Debug/Fluent.build/Objects-normal/x86_64/QueryBuilder~partial.swiftmodule /Users/joannisorlandos/Library/Developer/Xcode/DerivedData/Fluent-bfxtpijryoomwsgclfvoaxqqtfql/Build/Intermediates.noindex/Fluent.build/Debug/Fluent.build/Objects-normal/x86_64/DatabaseQuery~partial.swiftmodule /Users/joannisorlandos/Library/Developer/Xcode/DerivedData/Fluent-bfxtpijryoomwsgclfvoaxqqtfql/Build/Intermediates.noindex/Fluent.build/Debug/Fluent.build/Objects-normal/x86_64/Comparison~partial.swiftmodule /Users/joannisorlandos/Library/Developer/Xcode/DerivedData/Fluent-bfxtpijryoomwsgclfvoaxqqtfql/Build/Intermediates.noindex/Fluent.build/Debug/Fluent.build/Objects-normal/x86_64/Filter~partial.swiftmodule /Users/joannisorlandos/Library/Developer/Xcode/DerivedData/Fluent-bfxtpijryoomwsgclfvoaxqqtfql/Build/Intermediates.noindex/Fluent.build/Debug/Fluent.build/Objects-normal/x86_64/FilterMethod~partial.swiftmodule /Users/joannisorlandos/Library/Developer/Xcode/DerivedData/Fluent-bfxtpijryoomwsgclfvoaxqqtfql/Build/Intermediates.noindex/Fluent.build/Debug/Fluent.build/Objects-normal/x86_64/GroupRelation~partial.swiftmodule /Users/joannisorlandos/Library/Developer/Xcode/DerivedData/Fluent-bfxtpijryoomwsgclfvoaxqqtfql/Build/Intermediates.noindex/Fluent.build/Debug/Fluent.build/Objects-normal/x86_64/SubsetScope~partial.swiftmodule /Users/joannisorlandos/Library/Developer/Xcode/DerivedData/Fluent-bfxtpijryoomwsgclfvoaxqqtfql/Build/Intermediates.noindex/Fluent.build/Debug/Fluent.build/Objects-normal/x86_64/QueryAction~partial.swiftmodule /Users/joannisorlandos/Library/Developer/Xcode/DerivedData/Fluent-bfxtpijryoomwsgclfvoaxqqtfql/Build/Intermediates.noindex/Fluent.build/Debug/Fluent.build/Objects-normal/x86_64/QueryAggregate~partial.swiftmodule /Users/joannisorlandos/Library/Developer/Xcode/DerivedData/Fluent-bfxtpijryoomwsgclfvoaxqqtfql/Build/Intermediates.noindex/Fluent.build/Debug/Fluent.build/Objects-normal/x86_64/QueryField~partial.swiftmodule /Users/joannisorlandos/Library/Developer/Xcode/DerivedData/Fluent-bfxtpijryoomwsgclfvoaxqqtfql/Build/Intermediates.noindex/Fluent.build/Debug/Fluent.build/Objects-normal/x86_64/QueryJoin~partial.swiftmodule /Users/joannisorlandos/Library/Developer/Xcode/DerivedData/Fluent-bfxtpijryoomwsgclfvoaxqqtfql/Build/Intermediates.noindex/Fluent.build/Debug/Fluent.build/Objects-normal/x86_64/QueryRange~partial.swiftmodule /Users/joannisorlandos/Library/Developer/Xcode/DerivedData/Fluent-bfxtpijryoomwsgclfvoaxqqtfql/Build/Intermediates.noindex/Fluent.build/Debug/Fluent.build/Objects-normal/x86_64/QueryResultStream~partial.swiftmodule /Users/joannisorlandos/Library/Developer/Xcode/DerivedData/Fluent-bfxtpijryoomwsgclfvoaxqqtfql/Build/Intermediates.noindex/Fluent.build/Debug/Fluent.build/Objects-normal/x86_64/QuerySort~partial.swiftmodule /Users/joannisorlandos/Library/Developer/Xcode/DerivedData/Fluent-bfxtpijryoomwsgclfvoaxqqtfql/Build/Intermediates.noindex/Fluent.build/Debug/Fluent.build/Objects-normal/x86_64/QuerySupporting~partial.swiftmodule /Users/joannisorlandos/Library/Developer/Xcode/DerivedData/Fluent-bfxtpijryoomwsgclfvoaxqqtfql/Build/Intermediates.noindex/Fluent.build/Debug/Fluent.build/Objects-normal/x86_64/Children~partial.swiftmodule /Users/joannisorlandos/Library/Developer/Xcode/DerivedData/Fluent-bfxtpijryoomwsgclfvoaxqqtfql/Build/Intermediates.noindex/Fluent.build/Debug/Fluent.build/Objects-normal/x86_64/Parent~partial.swiftmodule /Users/joannisorlandos/Library/Developer/Xcode/DerivedData/Fluent-bfxtpijryoomwsgclfvoaxqqtfql/Build/Intermediates.noindex/Fluent.build/Debug/Fluent.build/Objects-normal/x86_64/Siblings~partial.swiftmodule /Users/joannisorlandos/Library/Developer/Xcode/DerivedData/Fluent-bfxtpijryoomwsgclfvoaxqqtfql/Build/Intermediates.noindex/Fluent.build/Debug/Fluent.build/Objects-normal/x86_64/DatabaseSchema~partial.swiftmodule /Users/joannisorlandos/Library/Developer/Xcode/DerivedData/Fluent-bfxtpijryoomwsgclfvoaxqqtfql/Build/Intermediates.noindex/Fluent.build/Debug/Fluent.build/Objects-normal/x86_64/SchemaAction~partial.swiftmodule /Users/joannisorlandos/Library/Developer/Xcode/DerivedData/Fluent-bfxtpijryoomwsgclfvoaxqqtfql/Build/Intermediates.noindex/Fluent.build/Debug/Fluent.build/Objects-normal/x86_64/SchemaBuilder~partial.swiftmodule /Users/joannisorlandos/Library/Developer/Xcode/DerivedData/Fluent-bfxtpijryoomwsgclfvoaxqqtfql/Build/Intermediates.noindex/Fluent.build/Debug/Fluent.build/Objects-normal/x86_64/SchemaCreator~partial.swiftmodule /Users/joannisorlandos/Library/Developer/Xcode/DerivedData/Fluent-bfxtpijryoomwsgclfvoaxqqtfql/Build/Intermediates.noindex/Fluent.build/Debug/Fluent.build/Objects-normal/x86_64/SchemaField~partial.swiftmodule /Users/joannisorlandos/Library/Developer/Xcode/DerivedData/Fluent-bfxtpijryoomwsgclfvoaxqqtfql/Build/Intermediates.noindex/Fluent.build/Debug/Fluent.build/Objects-normal/x86_64/SchemaReference~partial.swiftmodule /Users/joannisorlandos/Library/Developer/Xcode/DerivedData/Fluent-bfxtpijryoomwsgclfvoaxqqtfql/Build/Intermediates.noindex/Fluent.build/Debug/Fluent.build/Objects-normal/x86_64/SchemaSupporting~partial.swiftmodule /Users/joannisorlandos/Library/Developer/Xcode/DerivedData/Fluent-bfxtpijryoomwsgclfvoaxqqtfql/Build/Intermediates.noindex/Fluent.build/Debug/Fluent.build/Objects-normal/x86_64/SchemaUpdater~partial.swiftmodule /Users/joannisorlandos/Library/Developer/Xcode/DerivedData/Fluent-bfxtpijryoomwsgclfvoaxqqtfql/Build/Intermediates.noindex/Fluent.build/Debug/Fluent.build/Objects-normal/x86_64/FluentProvider~partial.swiftmodule /Users/joannisorlandos/Library/Developer/Xcode/DerivedData/Fluent-bfxtpijryoomwsgclfvoaxqqtfql/Build/Intermediates.noindex/Fluent.build/Debug/Fluent.build/Objects-normal/x86_64/DatabaseTransaction~partial.swiftmodule /Users/joannisorlandos/Library/Developer/Xcode/DerivedData/Fluent-bfxtpijryoomwsgclfvoaxqqtfql/Build/Intermediates.noindex/Fluent.build/Debug/Fluent.build/Objects-normal/x86_64/TransactionSupporting~partial.swiftmodule -parse-as-library -sil-merge-partial-modules -disable-diagnostic-passes -disable-sil-perf-optzns -target x86_64-apple-macosx10.10 -enable-objc-interop -sdk /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -I /Users/joannisorlandos/Library/Developer/Xcode/DerivedData/Fluent-bfxtpijryoomwsgclfvoaxqqtfql/Build/Products/Debug -F /Users/joannisorlandos/Library/Developer/Xcode/DerivedData/Fluent-bfxtpijryoomwsgclfvoaxqqtfql/Build/Products/Debug -F /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks -enable-testing -g -module-cache-path /Users/joannisorlandos/Library/Developer/Xcode/DerivedData/ModuleCache -swift-version 4 -enforce-exclusivity=checked -Onone -D SWIFT_PACKAGE -D Xcode -serialize-debugging-options -Xcc -I/Users/joannisorlandos/Library/Developer/Xcode/DerivedData/Fluent-bfxtpijryoomwsgclfvoaxqqtfql/Build/Intermediates.noindex/Fluent.build/Debug/Fluent.build/swift-overrides.hmap -Xcc -I/Users/joannisorlandos/Library/Developer/Xcode/DerivedData/Fluent-bfxtpijryoomwsgclfvoaxqqtfql/Build/Products/Debug/include -Xcc -I/Users/joannisorlandos/Library/Developer/Xcode/DerivedData/Fluent-bfxtpijryoomwsgclfvoaxqqtfql/Build/Intermediates.noindex/Fluent.build/Debug/Fluent.build/DerivedSources/x86_64 -Xcc -I/Users/joannisorlandos/Library/Developer/Xcode/DerivedData/Fluent-bfxtpijryoomwsgclfvoaxqqtfql/Build/Intermediates.noindex/Fluent.build/Debug/Fluent.build/DerivedSources -Xcc -working-directory/Users/joannisorlandos/Documents/Vapor/fluent -emit-module-doc-path /Users/joannisorlandos/Library/Developer/Xcode/DerivedData/Fluent-bfxtpijryoomwsgclfvoaxqqtfql/Build/Intermediates.noindex/Fluent.build/Debug/Fluent.build/Objects-normal/x86_64/Fluent.swiftdoc -module-name Fluent -emit-objc-header-path /Users/joannisorlandos/Library/Developer/Xcode/DerivedData/Fluent-bfxtpijryoomwsgclfvoaxqqtfql/Build/Intermediates.noindex/Fluent.build/Debug/Fluent.build/Objects-normal/x86_64/Fluent-Swift.h -o /Users/joannisorlandos/Library/Developer/Xcode/DerivedData/Fluent-bfxtpijryoomwsgclfvoaxqqtfql/Build/Intermediates.noindex/Fluent.build/Debug/Fluent.build/Objects-normal/x86_64/Fluent.swiftmodule 
1.	While reading from 'Fluent'
2.	While finishing conformance for type 'FluentCacheEntry<D>'
3.	While ... to 'Model' in module 'Fluent'```

Is there an SR for this? Does master of Fluent cause this crash? If not, it’d really really help if you could post a project that reproduces this, even if it’s large.

1 Like

I didn’t look into the SR’s yet, but I can post one with a project attached. It’ll be quite a big project, but if that doesn’t matter then that’s cool. Thanks for the feedback. Should I made 2 issues (one for each crash)?

That would be good, yes!

@Harlan_Haskins, here’s one of them at least: https://bugs.swift.org/browse/SR-6879

Let me know if that is sufficient info for repro.

Hmm that’s not right. Looks like logging in with GitHub is bad. This is my real account.

Am I correct that this is the second one? (i.e. the one in My experience with Conditional Conformances )

However, I unfortunately don’t understand how to reproduce the one from the main comment; what module has the Optional extension and how are you combining them? It’d be great if you could link to a branch that reproduces it, like the SR you filed.

Wait; I’m confused. That SR is a runtime crash (which I can reproduce), but both the problems here are the compiler crashing (which I can’t).