mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
SILGen: Fix SILGen for accessor functions with @_backDeploy. Previously, the @_backDeploy attribute was ignored when generating SIL for accessors on declarations with the attribute since the accessor decls themselves were not directly annotated.
Also, emit an error when `@_backDeploy` is applied to coroutine accessors since they are not supported yet. Resolves rdar://90112441
This commit is contained in:
@@ -45,27 +45,23 @@ public struct TopLevelStruct {
|
||||
// CHECK: @_backDeploy(macOS 12.0)
|
||||
// FROMSOURCE: public var backDeployedPropertyWithAccessors: Swift.Int {
|
||||
// FROMSOURCE: get { 45 }
|
||||
// FROMSOURCE: set(newValue) { print("set property") }
|
||||
// FROMSOURCE: }
|
||||
// FROMMODULE: public var backDeployedPropertyWithAccessors: Swift.Int
|
||||
@available(macOS 11.0, *)
|
||||
@_backDeploy(macOS 12.0)
|
||||
public var backDeployedPropertyWithAccessors: Int {
|
||||
get { 45 }
|
||||
set(newValue) { print("set property") }
|
||||
}
|
||||
|
||||
// CHECK: @_backDeploy(macOS 12.0)
|
||||
// FROMSOURCE: public subscript(index: Swift.Int) -> Swift.Int {
|
||||
// FROMSOURCE: get { 46 }
|
||||
// FROMSOURCE: set(newValue) { print("set subscript") }
|
||||
// FROMSOURCE: }
|
||||
// FROMMODULE: public subscript(index: Swift.Int) -> Swift.Int
|
||||
@available(macOS 11.0, *)
|
||||
@_backDeploy(macOS 12.0)
|
||||
public subscript(index: Int) -> Int {
|
||||
get { 46 }
|
||||
set(newValue) { print("set subscript") }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user