We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8613b05 commit 5431efaCopy full SHA for 5431efa
test/decl/var/property_wrappers.swift
@@ -1697,3 +1697,29 @@ struct SR_11381_W<T> {
1697
struct SR_11381_S {
1698
@SR_11381_W var foo: Int = nil // expected-error {{'nil' is not compatible with expected argument type 'Int'}}
1699
}
1700
+
1701
+// rdar://problem/53349209 - regression in property wrapper inference
1702
+struct Concrete1: P {}
1703
1704
+@propertyWrapper struct ConcreteWrapper {
1705
+ var wrappedValue: Concrete1 { get { fatalError() } }
1706
+}
1707
1708
+struct TestConcrete1 {
1709
+ @ConcreteWrapper() var s1
1710
1711
+ func f() {
1712
+ // Good:
1713
+ let _: P = self.s1
1714
1715
+ // Bad:
1716
+ self.g(s1: self.s1)
1717
1718
+ // Ugly:
1719
+ self.g(s1: self.s1 as P)
1720
+ }
1721
1722
+ func g(s1: P) {
1723
+ // ...
1724
1725
0 commit comments