Skip to content

IRGen createTypeMetadataAccessFunction crash #67861

Open
@aetherealtech

Description

@aetherealtech

Description

The following code causes the compiler to crash:

@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
public struct MakeExplode<Element, Source: Sequence> where Source.Element == () async -> Element {}

Steps to reproduce
Add the above code to a file in a Swift package and attempt to compile. The essential part seems to be the constraint to an async function whose return type is another type parameter (removing async or replacing Element with a specific type like Int avoids the crash).

Expected behavior
The code should either compile or trigger a compile error, but not a crash.

Environment

  • Swift compiler version info: swift-driver version: 1.75.2 Apple Swift version 5.8.1 (swiftlang-5.8.0.124.5 clang-1403.0.22.11.100) Target: x86_64-apple-macosx13.0
  • Xcode version info: Xcode 14.3.1 Build version 14E300c
  • Deployment target: macOS 10.13, iOS 11

Stack trace:

SwiftStackTrace.txt

Metadata

Metadata

Assignees

No one assigned

    Labels

    IRGenLLVM IR generationbugA deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itselfcrashBug: A crash, i.e., an abnormal termination of softwareswift 5.8swift 5.9

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions