Skip to content

Commit 0eae70c

Browse files
authored
Merge pull request #83961 from hamishknight/null-and-void
[IDE] Use `nullableTypesEqual` in `AfterPoundExprCompletion::sawSolutionImpl`
2 parents 412107f + 4aeb7e1 commit 0eae70c

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

lib/IDE/AfterPoundExprCompletion.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ void AfterPoundExprCompletion::sawSolutionImpl(const constraints::Solution &S) {
2828

2929
// If ExpectedTy is a duplicate of any other result, ignore this solution.
3030
auto IsEqual = [&](const Result &R) {
31-
return R.ExpectedTy->isEqual(ExpectedTy);
31+
return nullableTypesEqual(R.ExpectedTy, ExpectedTy);
3232
};
3333
if (!llvm::any_of(Results, IsEqual)) {
3434
bool IsImpliedResult = isImpliedResult(S, CompletionExpr);

validation-test/IDE/crashers/7dfd3dd444f43abb.swift

Lines changed: 0 additions & 4 deletions
This file was deleted.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
// {"kind":"complete","signature":"swift::ide::AfterPoundExprCompletion::sawSolutionImpl(swift::constraints::Solution const&)","signatureAssert":"Assertion failed: (Ptr && \"Cannot dereference a null Type!\"), function operator->"}
2-
// RUN: not --crash %target-swift-ide-test -code-completion -batch-code-completion -skip-filecheck -code-completion-diagnostics -source-filename %s
2+
// RUN: %target-swift-ide-test -code-completion -batch-code-completion -skip-filecheck -code-completion-diagnostics -source-filename %s
33
{##^COMPLETE^#
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// {"kind":"complete","signature":"swift::TypeBase::isEqual(swift::Type) const"}
2+
// RUN: %target-swift-ide-test -code-completion --code-completion-token=COMPLETE -code-completion-diagnostics -source-filename %s
3+
Set(
4+
##^COMPLETE^#

0 commit comments

Comments
 (0)