Skip to content

Commit d9abf18

Browse files
committed
Revert "[CSSimplify] Fix handling of holes by OptionalObject constraint"
This reverts commit 8b5e384.
1 parent cbfe349 commit d9abf18

File tree

2 files changed

+2
-24
lines changed

2 files changed

+2
-24
lines changed

lib/Sema/CSSimplify.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9179,8 +9179,8 @@ ConstraintSystem::simplifyOptionalObjectConstraint(
91799179
}
91809180

91819181
if (optTy->isPlaceholder()) {
9182-
// object type should be simplified because it could be already bound.
9183-
recordAnyTypeVarAsPotentialHole(simplifyType(second));
9182+
if (auto *typeVar = second->getAs<TypeVariableType>())
9183+
recordPotentialHole(typeVar);
91849184
return SolutionKind::Solved;
91859185
}
91869186

test/stmt/switch_stmt2.swift

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -150,25 +150,3 @@ func fallthrough_not_last(i: Int) {
150150
break
151151
}
152152
}
153-
154-
// rdar://117871338 - incorrect diagnostic - type of expression is ambiguous when member is missing.
155-
func test_invalid_optional_chaining() {
156-
func test(_: (E) -> Void) {
157-
}
158-
159-
enum E {
160-
case a
161-
case b
162-
}
163-
164-
struct S {
165-
var prop: E
166-
}
167-
168-
test {
169-
switch $0.prop? { // expected-error {{value of type 'E' has no member 'prop'}}
170-
case .a: break
171-
case .b: break
172-
}
173-
}
174-
}

0 commit comments

Comments
 (0)