Skip to content

Commit 7ab9ab9

Browse files
authored
Update TypeCheckConstraints.cpp
1 parent 1f16262 commit 7ab9ab9

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/Sema/TypeCheckConstraints.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -623,8 +623,10 @@ Type TypeChecker::typeCheckParameterDefault(Expr *&defaultValue,
623623
// Check whether generic parameters are only mentioned once in
624624
// the anchor's signature.
625625
{
626-
auto anchorTy = anchor->getInterfaceType()->castTo<GenericFunctionType>();
627-
626+
auto anchorTy = anchor->getInterfaceType()->castTo<AnyFunctionType>();
627+
628+
if (anchor->hasCurriedSelf())
629+
anchorTy = anchorTy->getResult()->castTo<AnyFunctionType>();
628630
// Reject if generic parameters are used in multiple different positions
629631
// in the parameter list.
630632

0 commit comments

Comments
 (0)