You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: test/decl/var/property_wrappers.swift
+15Lines changed: 15 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -799,15 +799,30 @@ struct WrapperC<Value> {
799
799
}
800
800
}
801
801
802
+
@propertyWrapper
803
+
structWrapperD<Value, X, Y>{ // expected-note{{property wrapper type 'WrapperD' declared here}}
804
+
varvalue:Value
805
+
}
806
+
807
+
@propertyWrapper
808
+
structWrapperE<Value>{
809
+
varvalue:Value
810
+
}
811
+
802
812
structTestComposition{
803
813
@WrapperA@WrapperB@WrapperCvarp1:Int?
804
814
@WrapperA@WrapperB@WrapperCvarp2="Hello"
815
+
@WrapperD<WrapperE,Int,String>@WrapperEvarp3:Int?
816
+
@WrapperD<WrapperC,Int,String>@WrapperCvarp4:Int?
817
+
@WrapperD<WrapperC,Int,String>@WrapperEvarp5:Int // expected-error{{property type 'Int' does not match that of the 'value' property of its wrapper type 'WrapperD<WrapperC, Int, String>'}}
805
818
806
819
func triggerErrors(d:Double){
807
820
p1 = d // expected-error{{cannot assign value of type 'Double' to type 'Int?'}}
808
821
p2 = d // expected-error{{cannot assign value of type 'Double' to type 'String?'}}
822
+
p3 = d // expected-error{{cannot assign value of type 'Double' to type 'Int?'}}
809
823
810
824
$p1 = d // expected-error{{cannot assign value of type 'Double' to type 'WrapperA<WrapperB<WrapperC<Int>>>'}}
811
825
$p2 = d // expected-error{{cannot assign value of type 'Double' to type 'WrapperA<WrapperB<WrapperC<String>>>'}}
826
+
$p3 = d // expected-error{{cannot assign value of type 'Double' to type 'WrapperD<WrapperE<Int?>, Int, String>'}}
0 commit comments