diff --git a/lib/Sema/ConstraintSystem.cpp b/lib/Sema/ConstraintSystem.cpp index 4d1dff495fdff..9100d34d24ba2 100644 --- a/lib/Sema/ConstraintSystem.cpp +++ b/lib/Sema/ConstraintSystem.cpp @@ -655,9 +655,9 @@ Optional> ConstraintSystem::getExprDepthAndParent( return None; } -Type ConstraintSystem::openUnboundGenericType(UnboundGenericType *unbound, - ConstraintLocatorBuilder locator, - OpenedTypeMap &replacements) { +Type +ConstraintSystem::openUnboundGenericType(UnboundGenericType *unbound, + ConstraintLocatorBuilder locator) { auto unboundDecl = unbound->getDecl(); auto parentTy = unbound->getParent(); if (parentTy) { @@ -667,6 +667,7 @@ Type ConstraintSystem::openUnboundGenericType(UnboundGenericType *unbound, } // Open up the generic type. + OpenedTypeMap replacements; openGeneric(unboundDecl->getDeclContext(), unboundDecl->getGenericSignature(), locator, replacements); @@ -790,8 +791,7 @@ Type ConstraintSystem::openUnboundGenericType( type = type.transform([&](Type type) -> Type { if (auto unbound = type->getAs()) { - OpenedTypeMap replacements; - return openUnboundGenericType(unbound, locator, replacements); + return openUnboundGenericType(unbound, locator); } return type; diff --git a/lib/Sema/ConstraintSystem.h b/lib/Sema/ConstraintSystem.h index be05109c2e095..d458367f0f40b 100644 --- a/lib/Sema/ConstraintSystem.h +++ b/lib/Sema/ConstraintSystem.h @@ -3411,8 +3411,7 @@ class ConstraintSystem { /// /// \returns The opened type. Type openUnboundGenericType(UnboundGenericType *unbound, - ConstraintLocatorBuilder locator, - OpenedTypeMap &replacements); + ConstraintLocatorBuilder locator); /// "Open" the given type by replacing any occurrences of unbound /// generic types with bound generic types with fresh type variables as