Skip to content

Closure parameter type cannot be inferred when contextual type is pack expansion #78426

@AnthonyLatsis

Description

@AnthonyLatsis

Description

No response

Reproduction

func foo<each T>(_: repeat each T) {
  let _: (repeat each T) -> Void = { x in }
}

Expected behavior

Successful compilation

Environment

Swift version 6.2-dev (LLVM 1a588e5b044c46f, Swift 9e70208d907bb2d)

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.closuresFeature: closurescompilerThe Swift compiler itselfexpressionsFeature: expressionsgenericsFeature: generic declarations and typesparameter packsFeature → generics: Parameter packsswift 6.2type checkerArea → compiler: Semantic analysisunexpected errorBug: Unexpected error

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions