Hi 👋,
Thanks for opening sourcing this. Sadly It doesn't compile with swift 4.1 (at least for me). I've tried commenting out the code to try to isolate the issue with no success so far. I'll update if I find a solution.
Travis Failures on 9.1
Assertion failed: (!ty->hasError() && "Serializing error type"), function addTypeRef, file /Users/buildnode/jenkins/workspace/oss-swift-4.1-package-osx/swift/lib/Serialization/Serialization.cpp, line 617.
0 swift 0x00000001060284d8 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 40
1 swift 0x0000000106028be6 SignalHandler(int) + 694
2 libsystem_platform.dylib 0x00007fffa2321b3a _sigtramp + 26
3 libsystem_platform.dylib 0x00007fafa130de10 _sigtramp + 4278108912
4 libsystem_c.dylib 0x00007fffa21a6420 abort + 129
5 libsystem_c.dylib 0x00007fffa216d893 basename_r + 0
6 swift 0x00000001039a2848 swift::serialization::Serializer::addTypeRef(swift::Type) + 408
7 swift 0x00000001039aa1d1 swift::serialization::Serializer::writeSubstitutions(llvm::ArrayRef<swift::Substitution>, std::__1::array<unsigned int, 256ul> const&, swift::GenericEnvironment*) + 161
8 swift 0x00000001039a9887 swift::serialization::Serializer::writeNormalConformance(swift::NormalProtocolConformance const*) + 2919
9 swift 0x00000001039b99fb swift::serialization::Serializer::writeAllDeclsAndTypes() + 2827
10 swift 0x00000001039baf6a swift::serialization::Serializer::writeAST(llvm::PointerUnion<swift::ModuleDecl*, swift::SourceFile*>, bool) + 3242
11 swift 0x00000001039c201b swift::serialization::Serializer::writeToStream(llvm::raw_ostream&, llvm::PointerUnion<swift::ModuleDecl*, swift::SourceFile*>, swift::SILModule const*, swift::SerializationOptions const&) + 139
12 swift 0x0000000103a03b73 void llvm::function_ref<void (llvm::raw_ostream&)>::callback_fn<swift::serialize(llvm::PointerUnion<swift::ModuleDecl*, swift::SourceFile*>, swift::SerializationOptions const&, swift::SILModule const*)::$_4>(long, llvm::raw_ostream&) + 179
13 swift 0x00000001039c3278 withOutputFile(swift::ASTContext&, llvm::StringRef, llvm::function_ref<void (llvm::raw_ostream&)>) + 440
14 swift 0x00000001039c303c swift::serialize(llvm::PointerUnion<swift::ModuleDecl*, swift::SourceFile*>, swift::SerializationOptions const&, swift::SILModule const*) + 220
15 swift 0x0000000102ae6709 std::__1::__function::__func<performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*, swift::UnifiedStatsReporter*)::$_6, std::__1::allocator<performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*, swift::UnifiedStatsReporter*)::$_6>, void ()>::operator()() + 617
16 swift 0x0000000103717e54 swift::SILModule::serialize() + 36
17 swift 0x0000000102adf2ed performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*, swift::UnifiedStatsReporter*) + 12621
18 swift 0x0000000102adb1b0 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 3376
19 swift 0x0000000102a9aa63 main + 3075
20 libdyld.dylib 0x00007fffa2112235 start + 1
21 libdyld.dylib 0x0000000000000048 start + 1575935508
Stack dump:
0. Program arguments: /Library/Developer/Toolchains/swift-4.1-RELEASE.xctoolchain/usr/bin/swift -frontend -merge-modules -emit-module /Users/iainsmith/Library/Developer/Xcode/DerivedData/URLQueryItemEncoder-bopdpxwfmmdflugdadetwtpslgjj/Build/Intermediates.noindex/URLQueryItemEncoder.build/Debug/URLQueryItemEncoder.build/Objects-normal/x86_64/URLQueryItemEncoder~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.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -I /Users/iainsmith/Library/Developer/Xcode/DerivedData/URLQueryItemEncoder-bopdpxwfmmdflugdadetwtpslgjj/Build/Products/Debug -F /Users/iainsmith/Library/Developer/Xcode/DerivedData/URLQueryItemEncoder-bopdpxwfmmdflugdadetwtpslgjj/Build/Products/Debug -application-extension -enable-testing -g -import-underlying-module -module-cache-path /Users/iainsmith/Library/Developer/Xcode/DerivedData/ModuleCache -swift-version 4 -enforce-exclusivity=checked -Onone -D DEBUG -serialize-debugging-options -report-errors-to-debugger -Xcc -I/Users/iainsmith/Library/Developer/Xcode/DerivedData/URLQueryItemEncoder-bopdpxwfmmdflugdadetwtpslgjj/Build/Intermediates.noindex/URLQueryItemEncoder.build/Debug/URLQueryItemEncoder.build/swift-overrides.hmap -Xcc -iquote -Xcc /Users/iainsmith/Library/Developer/Xcode/DerivedData/URLQueryItemEncoder-bopdpxwfmmdflugdadetwtpslgjj/Build/Intermediates.noindex/URLQueryItemEncoder.build/Debug/URLQueryItemEncoder.build/URLQueryItemEncoder-generated-files.hmap -Xcc -I/Users/iainsmith/Library/Developer/Xcode/DerivedData/URLQueryItemEncoder-bopdpxwfmmdflugdadetwtpslgjj/Build/Intermediates.noindex/URLQueryItemEncoder.build/Debug/URLQueryItemEncoder.build/URLQueryItemEncoder-own-target-headers.hmap -Xcc -I/Users/iainsmith/Library/Developer/Xcode/DerivedData/URLQueryItemEncoder-bopdpxwfmmdflugdadetwtpslgjj/Build/Intermediates.noindex/URLQueryItemEncoder.build/Debug/URLQueryItemEncoder.build/URLQueryItemEncoder-all-non-framework-target-headers.hmap -Xcc -ivfsoverlay -Xcc /Users/iainsmith/Library/Developer/Xcode/DerivedData/URLQueryItemEncoder-bopdpxwfmmdflugdadetwtpslgjj/Build/Intermediates.noindex/URLQueryItemEncoder.build/all-product-headers.yaml -Xcc -iquote -Xcc /Users/iainsmith/Library/Developer/Xcode/DerivedData/URLQueryItemEncoder-bopdpxwfmmdflugdadetwtpslgjj/Build/Intermediates.noindex/URLQueryItemEncoder.build/Debug/URLQueryItemEncoder.build/URLQueryItemEncoder-project-headers.hmap -Xcc -I/Users/iainsmith/Library/Developer/Xcode/DerivedData/URLQueryItemEncoder-bopdpxwfmmdflugdadetwtpslgjj/Build/Products/Debug/include -Xcc -I/Users/iainsmith/Library/Developer/Xcode/DerivedData/URLQueryItemEncoder-bopdpxwfmmdflugdadetwtpslgjj/Build/Intermediates.noindex/URLQueryItemEncoder.build/Debug/URLQueryItemEncoder.build/DerivedSources/x86_64 -Xcc -I/Users/iainsmith/Library/Developer/Xcode/DerivedData/URLQueryItemEncoder-bopdpxwfmmdflugdadetwtpslgjj/Build/Intermediates.noindex/URLQueryItemEncoder.build/Debug/URLQueryItemEncoder.build/DerivedSources -Xcc -DDEBUG=1 -Xcc -ivfsoverlay -Xcc /Users/iainsmith/Library/Developer/Xcode/DerivedData/URLQueryItemEncoder-bopdpxwfmmdflugdadetwtpslgjj/Build/Intermediates.noindex/URLQueryItemEncoder.build/Debug/URLQueryItemEncoder.build/unextended-module-overlay.yaml -Xcc -working-directory/Users/iainsmith/Code/TravisClient/Packages/URLQueryItemEncoder -emit-module-doc-path /Users/iainsmith/Library/Developer/Xcode/DerivedData/URLQueryItemEncoder-bopdpxwfmmdflugdadetwtpslgjj/Build/Intermediates.noindex/URLQueryItemEncoder.build/Debug/URLQueryItemEncoder.build/Objects-normal/x86_64/URLQueryItemEncoder.swiftdoc -module-name URLQueryItemEncoder -emit-objc-header-path /Users/iainsmith/Library/Developer/Xcode/DerivedData/URLQueryItemEncoder-bopdpxwfmmdflugdadetwtpslgjj/Build/Intermediates.noindex/URLQueryItemEncoder.build/Debug/URLQueryItemEncoder.build/Objects-normal/x86_64/URLQueryItemEncoder-Swift.h -o /Users/iainsmith/Library/Developer/Xcode/DerivedData/URLQueryItemEncoder-bopdpxwfmmdflugdadetwtpslgjj/Build/Intermediates.noindex/URLQueryItemEncoder.build/Debug/URLQueryItemEncoder.build/Objects-normal/x86_64/URLQueryItemEncoder.swiftmodule
1. While serializing type 'τ_1_0'