Files
swift-mirror/test/Concurrency/LLDBDebuggerFunctionActorExtension.swift
Adrian Prantl 5fe0c03d5f Allow functions marked @LLDBDebuggerFunction to bypass actor isolation checks
In order to allow LLDB to evaluate expressions inside an actor without spawining
async functions and potentially continue all threads, this relaxes the actor
isolation checks in @LLDBDebuggerFunction functions to allow a synchronous call
into an extension method.

rdar://75905336
2021-04-29 20:13:30 -07:00

22 lines
461 B
Swift

// RUN: %target-typecheck-verify-swift -enable-experimental-concurrency -debugger-support
// REQUIRES: concurrency
// This test simulates LLDB's expression evaluator makeing an otherwise illegal
// synchronous call into an extension of an actor, as it would to run `p n` in
// this example.
actor A {
var n : Int = 0
}
extension A {
final func lldb_wrapped_expr() {
n = 1
}
}
@LLDBDebuggerFunction
func lldb_expr(a: A) {
a.lldb_wrapped_expr()
}