mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
We used to wrap the base expression in an InOutExpr when accessing a computed property. This was a vestigial remnant of differences in the SILGen code paths for stored vs computed property access. These days SILGen doesn't care and is perfectly happy to call getters and setters with an LValueType base as well. This allows us to remove the call to getAccessSemantics(), which for a 'didSet', had to kick off type checking of the body. Fixes <rdar://problem/69532933>.
20 lines
259 B
Swift
20 lines
259 B
Swift
// RUN: %target-swift-frontend -typecheck %s
|
|
|
|
func doSomething(_: Int) {}
|
|
|
|
struct S {
|
|
var x: Int {
|
|
didSet {
|
|
doSomething(y)
|
|
doSomething(self.y)
|
|
}
|
|
}
|
|
|
|
var y: Int {
|
|
didSet {
|
|
doSomething(x)
|
|
doSomething(self.x)
|
|
}
|
|
}
|
|
}
|