Skip to content

Instantly share code, notes, and snippets.

@aryzae
Last active March 28, 2018 09:01
Show Gist options
  • Save aryzae/d4354e0099330b5f21bec29f37f43175 to your computer and use it in GitHub Desktop.
Save aryzae/d4354e0099330b5f21bec29f37f43175 to your computer and use it in GitHub Desktop.
DESERIALIZATION FAILURE
// 1ファイルで両方書いてある場合、Build成功
// 1ファイル1Protocolで書いてある場合、Build失敗
protocol ViewProtocol: class {
associatedtype Presenter: PresenterProtocol
var presenter: Presenter! { get }
}
protocol PresenterProtocol: class {
associatedtype View: ViewProtocol
weak var view: View? { get }
}
// ---
// Build失敗時の内容
<unknown>:0: error: fatal error encountered while reading from module 'Protocol'; please file a bug report with your project and the crash log
*** DESERIALIZATION FAILURE (please include this section in any bug report) ***
top-level value not found
Cross-reference to module 'Protocol'
... PresenterProtocol
0 swift 0x000000010f07636a PrintStackTraceSignalHandler(void*) + 42
1 swift 0x000000010f0757a6 SignalHandler(int) + 662
2 libsystem_platform.dylib 0x00007fffadcf6b3a _sigtramp + 26
3 libsystem_platform.dylib 0x00000001148ad86d _sigtramp + 1723559245
4 libsystem_c.dylib 0x00007fffadb7b420 abort + 129
5 swift 0x000000010c76d231 swift::ModuleFile::fatal(llvm::Error) + 1569
6 swift 0x000000010c777ada swift::ModuleFile::getDeclChecked(llvm::PointerEmbeddedInt<unsigned int, 31>, llvm::Optional<swift::DeclContext*>) + 41962
7 swift 0x000000010c76d6b4 swift::ModuleFile::getDecl(llvm::PointerEmbeddedInt<unsigned int, 31>, llvm::Optional<swift::DeclContext*>) + 84
8 swift 0x000000010c77a65c swift::ModuleFile::getTypeChecked(llvm::PointerEmbeddedInt<unsigned int, 31>) + 1836
9 swift 0x000000010c778658 swift::ModuleFile::readGenericRequirements(llvm::SmallVectorImpl<swift::Requirement>&, llvm::BitstreamCursor&) + 200
10 swift 0x000000010c774119 swift::ModuleFile::getDeclChecked(llvm::PointerEmbeddedInt<unsigned int, 31>, llvm::Optional<swift::DeclContext*>) + 27177
11 swift 0x000000010c81078a swift::SerializedASTFile::lookupValue(llvm::ArrayRef<std::__1::pair<swift::Identifier, swift::SourceLoc> >, swift::DeclName, swift::NLKind, llvm::SmallVectorImpl<swift::ValueDecl*>&) const + 1082
12 swift 0x000000010cc3441d void lookupInModule<llvm::SmallSet<swift::CanType, 4u, (anonymous namespace)::SortCanType>, swift::namelookup::lookupInModule(swift::ModuleDecl*, llvm::ArrayRef<std::__1::pair<swift::Identifier, swift::SourceLoc> >, swift::DeclName, llvm::SmallVectorImpl<swift::ValueDecl*>&, swift::NLKind, swift::namelookup::ResolutionKind, swift::LazyResolver*, swift::DeclContext const*, llvm::ArrayRef<std::__1::pair<llvm::ArrayRef<std::__1::pair<swift::Identifier, swift::SourceLoc> >, swift::ModuleDecl*> >)::$_0>(swift::ModuleDecl*, llvm::ArrayRef<std::__1::pair<swift::Identifier, swift::SourceLoc> >, llvm::SmallVectorImpl<swift::ValueDecl*>&, swift::namelookup::ResolutionKind, bool, swift::LazyResolver*, llvm::SmallDenseMap<std::__1::pair<llvm::ArrayRef<std::__1::pair<swift::Identifier, swift::SourceLoc> >, swift::ModuleDecl*>, llvm::TinyPtrVector<swift::ValueDecl*>, 32u, llvm::DenseMapInfo<std::__1::pair<llvm::ArrayRef<std::__1::pair<swift::Identifier, swift::SourceLoc> >, swift::ModuleDecl*> >, llvm::detail::DenseMapPair<std::__1::pair<llvm::ArrayRef<std::__1::pair<swift::Identifier, swift::SourceLoc> >, swift::ModuleDecl*>, llvm::TinyPtrVector<swift::ValueDecl*> > >&, swift::DeclContext const*, bool, llvm::ArrayRef<std::__1::pair<llvm::ArrayRef<std::__1::pair<swift::Identifier, swift::SourceLoc> >, swift::ModuleDecl*> >, swift::namelookup::lookupInModule(swift::ModuleDecl*, llvm::ArrayRef<std::__1::pair<swift::Identifier, swift::SourceLoc> >, swift::DeclName, llvm::SmallVectorImpl<swift::ValueDecl*>&, swift::NLKind, swift::namelookup::ResolutionKind, swift::LazyResolver*, swift::DeclContext const*, llvm::ArrayRef<std::__1::pair<llvm::ArrayRef<std::__1::pair<swift::Identifier, swift::SourceLoc> >, swift::ModuleDecl*> >)::$_0) + 333
13 swift 0x000000010cc34293 swift::namelookup::lookupInModule(swift::ModuleDecl*, llvm::ArrayRef<std::__1::pair<swift::Identifier, swift::SourceLoc> >, swift::DeclName, llvm::SmallVectorImpl<swift::ValueDecl*>&, swift::NLKind, swift::namelookup::ResolutionKind, swift::LazyResolver*, swift::DeclContext const*, llvm::ArrayRef<std::__1::pair<llvm::ArrayRef<std::__1::pair<swift::Identifier, swift::SourceLoc> >, swift::ModuleDecl*> >) + 1267
14 swift 0x000000010cc3cf7e swift::DeclContext::lookupQualified(swift::Type, swift::DeclName, swift::NLOptions, swift::LazyResolver*, llvm::SmallVectorImpl<swift::ValueDecl*>&) const + 1470
15 swift 0x000000010c77f08a swift::ModuleFile::resolveCrossReference(swift::ModuleDecl*, unsigned int) + 874
16 swift 0x000000010c7710e5 swift::ModuleFile::getDeclChecked(llvm::PointerEmbeddedInt<unsigned int, 31>, llvm::Optional<swift::DeclContext*>) + 14837
17 swift 0x000000010c77af63 swift::ModuleFile::getTypeChecked(llvm::PointerEmbeddedInt<unsigned int, 31>) + 4147
18 swift 0x000000010c77317f swift::ModuleFile::getDeclChecked(llvm::PointerEmbeddedInt<unsigned int, 31>, llvm::Optional<swift::DeclContext*>) + 23183
19 swift 0x000000010c76d6b4 swift::ModuleFile::getDecl(llvm::PointerEmbeddedInt<unsigned int, 31>, llvm::Optional<swift::DeclContext*>) + 84
20 swift 0x000000010c77a65c swift::ModuleFile::getTypeChecked(llvm::PointerEmbeddedInt<unsigned int, 31>) + 1836
21 swift 0x000000010c778658 swift::ModuleFile::readGenericRequirements(llvm::SmallVectorImpl<swift::Requirement>&, llvm::BitstreamCursor&) + 200
22 swift 0x000000010c774119 swift::ModuleFile::getDeclChecked(llvm::PointerEmbeddedInt<unsigned int, 31>, llvm::Optional<swift::DeclContext*>) + 27177
23 swift 0x000000010c7a821e swift::ModuleFile::getTopLevelDecls(llvm::SmallVectorImpl<swift::Decl*>&) + 1998
24 swift 0x000000010c4351f0 swift::SILPassManager::SILPassManager(swift::SILModule*, llvm::StringRef) + 1712
25 swift 0x000000010c43b88f swift::runSILDiagnosticPasses(swift::SILModule&) + 175
26 swift 0x000000010b9d303f performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*, swift::UnifiedStatsReporter*) + 13791
27 swift 0x000000010b9ce1f4 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 7716
28 swift 0x000000010b982e78 main + 12248
29 libdyld.dylib 0x00007fffadae7235 start + 1
30 libdyld.dylib 0x000000000000003c start + 1381076488
Stack dump:
0. Program arguments: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -emit-module /Users/a999-277/Library/Developer/Xcode/DerivedData/Protocol-dgrffwdherhlczaqvikvjmkmndjq/Build/Intermediates.noindex/Protocol.build/Debug-iphonesimulator/Protocol.build/Objects-normal/x86_64/PresenterProtocol~partial.swiftmodule /Users/a999-277/Library/Developer/Xcode/DerivedData/Protocol-dgrffwdherhlczaqvikvjmkmndjq/Build/Intermediates.noindex/Protocol.build/Debug-iphonesimulator/Protocol.build/Objects-normal/x86_64/ViewController~partial.swiftmodule /Users/a999-277/Library/Developer/Xcode/DerivedData/Protocol-dgrffwdherhlczaqvikvjmkmndjq/Build/Intermediates.noindex/Protocol.build/Debug-iphonesimulator/Protocol.build/Objects-normal/x86_64/AppDelegate~partial.swiftmodule /Users/a999-277/Library/Developer/Xcode/DerivedData/Protocol-dgrffwdherhlczaqvikvjmkmndjq/Build/Intermediates.noindex/Protocol.build/Debug-iphonesimulator/Protocol.build/Objects-normal/x86_64/ViewProtocol~partial.swiftmodule -parse-as-library -target x86_64-apple-ios11.2 -enable-objc-interop -sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.2.sdk -I /Users/a999-277/Library/Developer/Xcode/DerivedData/Protocol-dgrffwdherhlczaqvikvjmkmndjq/Build/Products/Debug-iphonesimulator -F /Users/a999-277/Library/Developer/Xcode/DerivedData/Protocol-dgrffwdherhlczaqvikvjmkmndjq/Build/Products/Debug-iphonesimulator -enable-testing -g -module-cache-path /Users/a999-277/Library/Developer/Xcode/DerivedData/ModuleCache -swift-version 4 -enforce-exclusivity=checked -D DEBUG -serialize-debugging-options -report-errors-to-debugger -Xcc -I/Users/a999-277/Library/Developer/Xcode/DerivedData/Protocol-dgrffwdherhlczaqvikvjmkmndjq/Build/Intermediates.noindex/Protocol.build/Debug-iphonesimulator/Protocol.build/swift-overrides.hmap -Xcc -iquote -Xcc /Users/a999-277/Library/Developer/Xcode/DerivedData/Protocol-dgrffwdherhlczaqvikvjmkmndjq/Build/Intermediates.noindex/Protocol.build/Debug-iphonesimulator/Protocol.build/Protocol-generated-files.hmap -Xcc -I/Users/a999-277/Library/Developer/Xcode/DerivedData/Protocol-dgrffwdherhlczaqvikvjmkmndjq/Build/Intermediates.noindex/Protocol.build/Debug-iphonesimulator/Protocol.build/Protocol-own-target-headers.hmap -Xcc -I/Users/a999-277/Library/Developer/Xcode/DerivedData/Protocol-dgrffwdherhlczaqvikvjmkmndjq/Build/Intermediates.noindex/Protocol.build/Debug-iphonesimulator/Protocol.build/Protocol-all-target-headers.hmap -Xcc -iquote -Xcc /Users/a999-277/Library/Developer/Xcode/DerivedData/Protocol-dgrffwdherhlczaqvikvjmkmndjq/Build/Intermediates.noindex/Protocol.build/Debug-iphonesimulator/Protocol.build/Protocol-project-headers.hmap -Xcc -I/Users/a999-277/Library/Developer/Xcode/DerivedData/Protocol-dgrffwdherhlczaqvikvjmkmndjq/Build/Products/Debug-iphonesimulator/include -Xcc -I/Users/a999-277/Library/Developer/Xcode/DerivedData/Protocol-dgrffwdherhlczaqvikvjmkmndjq/Build/Intermediates.noindex/Protocol.build/Debug-iphonesimulator/Protocol.build/DerivedSources/x86_64 -Xcc -I/Users/a999-277/Library/Developer/Xcode/DerivedData/Protocol-dgrffwdherhlczaqvikvjmkmndjq/Build/Intermediates.noindex/Protocol.build/Debug-iphonesimulator/Protocol.build/DerivedSources -Xcc -DDEBUG=1 -Xcc -working-directory/Users/a999-277/Documents/personal/Programs/Protocol -emit-module-doc-path /Users/a999-277/Library/Developer/Xcode/DerivedData/Protocol-dgrffwdherhlczaqvikvjmkmndjq/Build/Intermediates.noindex/Protocol.build/Debug-iphonesimulator/Protocol.build/Objects-normal/x86_64/Protocol.swiftdoc -module-name Protocol -emit-objc-header-path /Users/a999-277/Library/Developer/Xcode/DerivedData/Protocol-dgrffwdherhlczaqvikvjmkmndjq/Build/Intermediates.noindex/Protocol.build/Debug-iphonesimulator/Protocol.build/Objects-normal/x86_64/Protocol-Swift.h -o /Users/a999-277/Library/Developer/Xcode/DerivedData/Protocol-dgrffwdherhlczaqvikvjmkmndjq/Build/Intermediates.noindex/Protocol.build/Debug-iphonesimulator/Protocol.build/Objects-normal/x86_64/Protocol.swiftmodule
1. While reading from 'Protocol'
2. While deserializing 'PresenterProtocol' (ProtocolDecl #1) in 'Protocol'
3. While deserializing 'View' (AssociatedTypeDecl #2) in 'Protocol'
4. While deserializing decl #8 (XREF) in 'Protocol'
5. Cross-reference to module 'Protocol'
... ViewProtocol
6. While reading from 'Protocol'
7. While deserializing 'ViewProtocol' (ProtocolDecl #1) in 'Protocol'
8. While deserializing 'Presenter' (AssociatedTypeDecl #2) in 'Protocol'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment