Skip to content

Conversation

@hamishknight
Copy link
Contributor

@hamishknight hamishknight commented Jan 19, 2026

If we have (_: $T0), avoid flattening to $T0 since for a pack expansion type variable that would result in a bare pack type instead of a tuple. Instead, leave the flattening for TypeSimplifier.

Resolves #86629
Resolves #86628
rdar://168407842&168407626

If we have `(_: $T0)`, avoid flattening to `$T0` since for a pack
expansion type variable that would result in a bare pack type instead
of a tuple. Instead, leave the flattening for TypeSimplifier.
This only seemed to exist to stop type variable tuple singletons from
being flattened, but that's now always the behavior.
@hamishknight
Copy link
Contributor Author

@swift-ci please test

@hamishknight
Copy link
Contributor Author

@swift-ci please test source compatibility

// flattening in this case.
if (elements.size() == 1 &&
!elements[0].getType()->is<PackExpansionType>() &&
!elements[0].getType()->is<TypeVariableType>() &&
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably if it’s a type variable and can bind to a pack?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants