[AST] Introduce PlaceholderType and ThePlaceholderType singleton

This commit is contained in:
Frederick Kellison-Linn
2020-10-24 17:31:08 -04:00
committed by Freddy Kellison-Linn
parent 580fd40540
commit d78d95ef0d
12 changed files with 56 additions and 3 deletions

View File

@@ -4901,6 +4901,9 @@ ConstraintSystem::matchTypes(Type type1, Type type2, ConstraintKind kind,
case TypeKind::Unresolved:
return getTypeMatchFailure(locator);
case TypeKind::Placeholder:
llvm_unreachable("placeholders should already be converted to type vars");
case TypeKind::Hole: {
// If it's allowed to attempt fixes, let's delegate
// decision to `repairFailures`, since depending on
@@ -5596,6 +5599,7 @@ ConstraintSystem::simplifyConstructionConstraint(
llvm_unreachable("artificial type in constraint");
case TypeKind::Unresolved:
case TypeKind::Placeholder:
case TypeKind::Error:
case TypeKind::Hole:
return SolutionKind::Error;