Skip to content

[SR-14063] Crash on function arg to param conversion thick-to-thin #56452

Open
@LucianoPAlmeida

Description

@LucianoPAlmeida
Previous ID SR-14063
Radar rdar://problem/73357725
Original Reporter @LucianoPAlmeida
Type Bug
Environment

Xcode 12.3 (12C33), also on main

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug
Assignee None
Priority Medium

md5: eb8af9ebc5482718539e63a2621ba046

Issue Description:

Just a thick to thin representation mismatch that crashes the compiler.

class A {}

func bar<U>(_: @escaping (U) -> Void) -> (U) -> Void {
  return { _ in }
}
func b<T, U>(_ p: @convention(thin) (T) -> U) {}
func a<W: A>(_ arr: [(String, (W) -> Void)]) {
  b({ (s: String, b: @escaping (W) -> Void) in (a, bar(b)) }) // crash on conversion of argument
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    @conventionFeature → attributes: the @convention attributeSILGenArea → compiler: The SIL generation stageattributesFeature: Declaration and type attributesbugA deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itselfcrashBug: A crash, i.e., an abnormal termination of softwarefunction typesFeature → types: function typesgenericsFeature: generic declarations and typesimplicit conversionsFeature: implicit conversionsswift 5.9

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions