Revert "[CSSimplify] Fix handling of holes by OptionalObject constraint"

This reverts commit 8b5e3848a1.
This commit is contained in:
Pavel Yaskevich
2023-12-01 13:03:20 -08:00
parent cbfe349e33
commit d9abf188cc
2 changed files with 2 additions and 24 deletions

View File

@@ -9179,8 +9179,8 @@ ConstraintSystem::simplifyOptionalObjectConstraint(
}
if (optTy->isPlaceholder()) {
// object type should be simplified because it could be already bound.
recordAnyTypeVarAsPotentialHole(simplifyType(second));
if (auto *typeVar = second->getAs<TypeVariableType>())
recordPotentialHole(typeVar);
return SolutionKind::Solved;
}

View File

@@ -150,25 +150,3 @@ func fallthrough_not_last(i: Int) {
break
}
}
// rdar://117871338 - incorrect diagnostic - type of expression is ambiguous when member is missing.
func test_invalid_optional_chaining() {
func test(_: (E) -> Void) {
}
enum E {
case a
case b
}
struct S {
var prop: E
}
test {
switch $0.prop? { // expected-error {{value of type 'E' has no member 'prop'}}
case .a: break
case .b: break
}
}
}