mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Strict memory safety] Eliminate false cycle when checking nonisolated(unsafe)
Whenc hecking for nonisolated(unsafe), don't evaluate the full isolation of the entity, because doing so causes a reference cycle.
This commit is contained in:
@@ -43,3 +43,15 @@ final class MyExecutor: SerialExecutor {
|
||||
func enqueue(_ job: consuming ExecutorJob) { fatalError("boom") }
|
||||
@unsafe func asUnownedSerialExecutor() -> UnownedSerialExecutor { fatalError("boom") }
|
||||
}
|
||||
|
||||
// Ensure that this does not cause a reference cycle.
|
||||
public struct TokenSyntax { }
|
||||
public struct Syntax { }
|
||||
|
||||
open class SyntaxVisitor {
|
||||
open func visit(_ token: TokenSyntax) { }
|
||||
}
|
||||
|
||||
open class SyntaxAnyVisitor: SyntaxVisitor {
|
||||
override open func visit(_ token: TokenSyntax) { }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user