[CSSimplify] Propagate contextual types to pack expansion variables

If there are explicit generic arguments that fully resolves the
pack expansion, let's bind opened pack expansion to its contextual
type early (while resolving pack expansion variable), doing so
helps with performance and diagnostics.
This commit is contained in:
Pavel Yaskevich
2023-04-24 09:30:23 -07:00
committed by Pavel Yaskevich
parent 943ef19a1d
commit cbfec20f08
3 changed files with 59 additions and 27 deletions

View File

@@ -3892,11 +3892,11 @@ public:
/// variable representing a pack expansion type, let's resolve the expansion.
///
/// \param typeVar The type variable representing pack expansion type.
/// \param locator The locator associated with contextual type.
/// \param contextualType The contextual type this pack expansion variable
/// would be bound/equated to.
///
/// \returns `true` if pack expansion has been resolved, `false` otherwise.
bool resolvePackExpansion(TypeVariableType *typeVar,
ConstraintLocatorBuilder locator);
bool resolvePackExpansion(TypeVariableType *typeVar, Type contextualType);
/// Assign a fixed type to the given type variable.
///