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/type/runtime_discoverable_attrs.swift
+17Lines changed: 17 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -14,6 +14,23 @@ struct OnlyPropsTest<B, V> {
14
14
init(attachedTo:KeyPath<B,V>){}
15
15
}
16
16
17
+
@runtimeMetadata
18
+
structNoInitAttr{ // expected-error {{runtime attribute type 'NoInitAttr' does not contain a required initializer - init(attachedTo:)}}
19
+
}
20
+
21
+
@runtimeMetadata
22
+
structFailiableInit{
23
+
init?(attachedTo:Any){} // expected-error {{runtime attribute type initializer 'init(attachedTo:)' cannot be failable}}
24
+
}
25
+
26
+
@runtimeMetadata
27
+
publicstructAccessMismatchInAttr{
28
+
privateinit(attachedTo:Any){}
29
+
// expected-error@-1 {{private initializer 'init(attachedTo:)' cannot have more restrictive access than its enclosing runtime attribute type 'AccessMismatchInAttr' (which is public)}}
30
+
internalinit<T>(attachedTo:T.Type, other:Int){}
31
+
// expected-error@-1 {{internal initializer 'init(attachedTo:other:)' cannot have more restrictive access than its enclosing runtime attribute type 'AccessMismatchInAttr' (which is public)}}
0 commit comments