Skip to content

Commit 27b7420

Browse files
committed
Fix for crash 28290 in findGenericSubstitutions
Early out needs to check that the types don’t contain UnresolvedType, not just that they aren’t UnresolvedType at the top level.
1 parent 55b8555 commit 27b7420

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/Sema/CSDiag.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1025,8 +1025,8 @@ static bool findGenericSubstitutions(DeclContext *dc, Type paramType,
10251025
Type actualArgType,
10261026
TypeSubstitutionMap &archetypesMap) {
10271027
// Type visitor doesn't handle unresolved types.
1028-
if (paramType->is<UnresolvedType>() ||
1029-
actualArgType->is<UnresolvedType>())
1028+
if (paramType->hasUnresolvedType() ||
1029+
actualArgType->hasUnresolvedType())
10301030
return false;
10311031

10321032
class GenericVisitor : public TypeMatcher<GenericVisitor> {

validation-test/compiler_crashers/28290-swift-constraints-constraintsystem-diagnosefailureforexpr.swift renamed to validation-test/compiler_crashers_fixed/28290-swift-constraints-constraintsystem-diagnosefailureforexpr.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55
// See http://swift.org/LICENSE.txt for license information
66
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
77

8-
// RUN: not --crash %target-swift-frontend %s -parse
8+
// RUN: not %target-swift-frontend %s -parse
99
func a{{String($0}{u
1010
return{

0 commit comments

Comments
 (0)