Files
swift-mirror/test/ModuleInterface/var-with-init-and-accessors.swiftinterface
Rintaro Ishizaki f8911bc257 [ASTPrinter] Disambiguation marker for simple-stored var accessor block
Previously, the `@_accessorBlock` disambiguation attribute was only
emitted for observed variables. But We need `@_accessorBlock`
disambiguation marker for simple stored properties with non-public
setters in `@frozen` types too.

rdar://171819084
2026-03-05 14:14:41 -08:00

23 lines
898 B
Plaintext

// RUN: %empty-directory(%t)
// RUN: %target-swift-frontend -emit-module -o %t/Test.swiftmodule -emit-module-interface-path %t/Test.swiftinterface -module-name Test %s
// RUN: %target-swift-typecheck-module-from-interface(%t/Test.swiftinterface) -module-name Test
// RUN: %FileCheck %s --check-prefix INTERFACE --input-file %t/Test.swiftinterface
@frozen public struct Struct {
public var values: [Int] = .init() {
willSet {}
}
public internal(set) var dict: [String: Int] = [:]
}
// INTERFACE: @frozen public struct Struct {
// INTERFACE-LABEL: @_hasStorage public var values: [Swift::Int] = .init() { @_accessorBlock
// INTERFACE-NEXT: @_transparent get
// INTERFACE-NEXT: set
// INTERFACE-NEXT: }
// INTERFACE-LABEL: @_hasStorage public var dict: [Swift::String : Swift::Int] = [:] { @_accessorBlock
// INTERFACE-NEXT: get
// INTERFACE-NEXT: }
// INTERFACE: }