mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Relax Restrictions on Placeholder Types Appearing in Interface Types
These restrictions are meant to keep placeholder types from escaping TypeCheckType. But there's really no harm in that happening as long as we diagnose it on the way out in the places it's banned. (We also need to make sure we're only diagnosing things in primaries, but that's a minor issue). The end result is that we lose information because a lot of the AST that has placeholders in it becomes filled with error types instead. Lift the restriction on placeholders appearing in the interface type, teach the mangler to treat them as unresolved types, and teach serialization to treat them as error types.
This commit is contained in:
@@ -4289,6 +4289,13 @@ public:
|
||||
}
|
||||
|
||||
void visitPlaceholderType(const PlaceholderType *) {
|
||||
// If for some reason we have a placeholder type while compiling with
|
||||
// errors, just serialize an ErrorType and continue.
|
||||
if (S.getASTContext().LangOpts.AllowModuleWithCompilerErrors) {
|
||||
visitErrorType(
|
||||
cast<ErrorType>(ErrorType::get(S.getASTContext()).getPointer()));
|
||||
return;
|
||||
}
|
||||
llvm_unreachable("should not serialize a PlaceholderType");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user