Files
swift-mirror/test/Constraints/issue-66561.swift
Hamish Knight f18293bf7c [CS] Walk ExprPattern conjunction elements when finding type variables
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
2023-06-12 18:27:26 +01:00

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
}
}
}