mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Apply the same logic that we apply to other conjunction elements, to make sure that e.g property wrapper projected values work correctly. rdar://110649179
37 lines
546 B
Swift
37 lines
546 B
Swift
// RUN: %target-typecheck-verify-swift
|
|
|
|
// https://github.com/apple/swift/issues/66561
|
|
|
|
@propertyWrapper
|
|
struct WrapperValue<Value> {
|
|
var value: Value
|
|
init(wrappedValue: Value) {
|
|
self.value = wrappedValue
|
|
}
|
|
|
|
var projectedValue: Self {
|
|
return self
|
|
}
|
|
|
|
var wrappedValue: Value {
|
|
get {
|
|
self.value
|
|
}
|
|
set {
|
|
self.value = newValue
|
|
}
|
|
}
|
|
}
|
|
|
|
func test() {
|
|
let _ = {
|
|
@WrapperValue var value: Bool = false
|
|
switch value {
|
|
case $value.wrappedValue:
|
|
break
|
|
default:
|
|
break
|
|
}
|
|
}
|
|
}
|