File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed
validation-test/Serialization/AllowErrors Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -4168,6 +4168,13 @@ class Serializer::TypeSerializer : public TypeVisitor<TypeSerializer> {
41684168 }
41694169
41704170 void visitUnresolvedType (const UnresolvedType *) {
4171+ // If for some reason we have an unresolved type while compiling with
4172+ // errors, just serialize an ErrorType and continue.
4173+ if (S.getASTContext ().LangOpts .AllowModuleWithCompilerErrors ) {
4174+ visitErrorType (
4175+ cast<ErrorType>(ErrorType::get (S.getASTContext ()).getPointer ()));
4176+ return ;
4177+ }
41714178 llvm_unreachable (" should not serialize an UnresolvedType" );
41724179 }
41734180
Original file line number Diff line number Diff line change 1+ // RUN: %empty-directory(%t)
2+
3+ // RUN: %target-swift-frontend -module-name errors -emit-module -o %t/errors.swiftmodule -experimental-allow-module-with-compiler-errors %s
4+
5+ protocol SomeProto { }
6+
7+ extension SomeProto {
8+ func someFunc( arg:
9+
10+ enum SomeEnum {
11+ case a
12+ }
You can’t perform that action at this time.
0 commit comments