Files
swift-mirror/validation-test/compiler_crashers_fixed/SILGenFunction-emitActorIsolationErasureThunk-78dcaf.swift
Pavel Yaskevich 5097a86b88 [CSApply] Don't use special isolation erasure for global-actor to @isolated(any) conversions
Regular `FunctionConversionExpr` handles that correctly and
`ActorIsolationErasureExpr` should only be used for cases when
the resulting type is `nonisolated`.

Resolves: rdar://171146729
2026-03-10 20:21:17 -07:00

23 lines
814 B
Swift

// {"signature":"swift::Lowering::SILGenFunction::emitActorIsolationErasureThunk(swift::SILLocation, swift::Lowering::ManagedValue, swift::CanTypeWrapper<swift::AnyFunctionType>, swift::CanTypeWrapper<swift::AnyFunctionType>)","signatureAssert":"Assertion failed: (!expectedType->hasErasedIsolation()), function emitActorIsolationErasureThunk"}
//
// RUN: %empty-directory(%t)
//
// RUN: %target-swift-frontend -emit-module -module-name Lib -emit-module-path %t/Lib.swiftmodule -DLib %s \
// RUN: -language-mode 5
// RUN: %target-swift-emit-silgen -I %t %s \
// RUN: -language-mode 6 -verify
//
// rdar://171146729
#if Lib
public struct Foo {
public func bar(_: @isolated(any) @Sendable (Foo) -> Void) {
}
}
#else
import Lib
func test(foo: Foo) {
foo.bar { @MainActor _ in
}
}
#endif