mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Revert "[CSSimplify] Fix handling of holes by OptionalObject constraint"
This reverts commit 8b5e3848a1.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user