mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
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
22 lines
461 B
Swift
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()
|
|
}
|