Skip to content

Commit 49f1442

Browse files
authored
Merge pull request #6085 from nathawes/rdar28867801
[code-completion] Fix crash in printParameterList when paramListTy is…
2 parents 73f3b94 + d039da1 commit 49f1442

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

lib/AST/ASTPrinter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2461,7 +2461,7 @@ void PrintAST::printParameterList(ParameterList *PL, Type paramListTy,
24612461
bool isCurried,
24622462
std::function<bool()> isAPINameByDefault) {
24632463
SmallVector<ParameterTypeFlags, 4> paramFlags;
2464-
if (paramListTy) {
2464+
if (paramListTy && !paramListTy->hasError()) {
24652465
if (auto parenTy = dyn_cast<ParenType>(paramListTy.getPointer())) {
24662466
paramFlags.push_back(parenTy->getParameterFlags());
24672467
} else if (auto tupleTy = paramListTy->getAs<TupleType>()) {

validation-test/IDE/crashers/101-swift-decl-print.swift

Lines changed: 0 additions & 3 deletions
This file was deleted.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// RUN: %target-swift-ide-test -code-completion -code-completion-token=A -source-filename=%s
2+
class A{func b(a c s:]class c:A{#^A^#

0 commit comments

Comments
 (0)