Compiler crash when declaring async function in an extension of a generic ObjC class that uses the generic parameter as a return type #63741
Labels
async & await
Feature → concurrency: asynchronous function aka the async/await pattern
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
compiler
The Swift compiler itself
concurrency
Feature: umbrella label for concurrency language features
crash
Bug: A crash, i.e., an abnormal termination of software
generics
Feature: generic declarations and types
objective-c interop
Feature: Interoperability with Objective-C
swift 5.7
Description
Declaring an
async
function in anextension
of a generic Objective-C class, results in a compiler crash with the following stack-trace when the generic parameter is used as a return type of the function.Steps to reproduce
Expected behavior
Code compiles successfully similar to:
async
function returning a specific type instead of theT
parameter compilesasync
function that's alsothrows
returningT
also compilesOr if it's not possible to compile, then it should report an error instead of the crash.
Environment
swift-driver version: 1.62.15 Apple Swift version 5.7.2 (swiftlang-5.7.2.135.5 clang-1400.0.29.51)
Xcode 14.2 Build version 14C18
macOS 12.3
NOTE: The "similar to" points only work when building in release mode (more specifically just setting the
Optimization Level
to-O
is enough). I'll be submitting a separate issue report for a compiler crash that happens when theOptimization Level
is set to-Onone
and the type parameter is used anywhere in the function signature (except when used as a generic argument of a different class that's used in the signature instead).The text was updated successfully, but these errors were encountered: