[ConstraintSystem] Rework handling of object literal expressions

Instead of special casing argument-to-parameter matching for
object literal expressions, let's allow constraint system to
lookup a witness initializer and apply it to the given set
of arguments.

This also simplifies constraint application because
`coerceCallArguments` could be used to form type-checked
argument expression.
This commit is contained in:
Pavel Yaskevich
2020-06-19 16:30:47 -07:00
parent ebb2e68a1f
commit 92271e9ce5
6 changed files with 91 additions and 38 deletions

View File

@@ -6754,7 +6754,7 @@ ConstraintSystem::SolutionKind ConstraintSystem::simplifyMemberConstraint(
return SolutionKind::Solved;
} else if ((kind == ConstraintKind::ValueMember ||
kind == ConstraintKind::ValueWitness) &&
baseObjTy->isHole()) {
baseObjTy->getMetatypeInstanceType()->isHole()) {
// If base type is a "hole" there is no reason to record any
// more "member not found" fixes for chained member references.
markMemberTypeAsPotentialHole(memberTy);