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
// Okay because there is a valid `init(storage:)` overload.
33
+
// Okay because there is a valid `init(for:storage:)` overload.
34
34
@typeWrapper
35
-
structFailableAndValidInit<S>{
35
+
structFailableAndValidInit<W,S>{
36
36
// expected-error@-1 {{type wrapper type 'FailableAndValidInit' does not contain a required writable subscript}}
37
-
// expected-note@-2 {{do you want to add a stub?}} {{33-33=\nsubscript<Value>(storageKeyPath path: WritableKeyPath<<#Base#>, Value>) -> Value { get { <#code#> \} set { <#code#> \} \}}}
37
+
// expected-note@-2 {{do you want to add a stub?}} {{36-36=\nsubscript<Value>(storageKeyPath path: WritableKeyPath<<#Base#>, Value>) -> Value { get { <#code#> \} set { <#code#> \} \}}}
// expected-error@-1 {{fileprivate initializer 'init(storage:)' cannot have more restrictive access than its enclosing type wrapper type 'InaccessibleInit' (which is public)}}
51
+
publicstructInaccessibleInit<W,S>{
52
+
fileprivateinit(for:W.Type,storage:S){
53
+
// expected-error@-1 {{fileprivate initializer 'init(for:storage:)' cannot have more restrictive access than its enclosing type wrapper type 'InaccessibleInit' (which is public)}}
54
54
}
55
55
56
-
privateinit?(storage:S)where S:AnyObject{
57
-
// expected-error@-1 {{private initializer 'init(storage:)' cannot have more restrictive access than its enclosing type wrapper type 'InaccessibleInit' (which is public)}}
58
-
// expected-error@-2 {{type wrapper initializer 'init(storage:)' cannot be failable}}
// expected-error@-1 {{private initializer 'init(for:storage:)' cannot have more restrictive access than its enclosing type wrapper type 'InaccessibleInit' (which is public)}}
58
+
// expected-error@-2 {{type wrapper initializer 'init(for:storage:)' cannot be failable}}
// expected-error@-1 {{fileprivate subscript 'subscript(storageKeyPath:)' cannot have more restrictive access than its enclosing type wrapper type 'InaccessibleOrInvalidSubscripts' (which is internal)}}
// expected-error@-1 {{type wrapper type 'MissingReadOnly' does not contain a required ready-only subscript}}
461
-
// expected-note@-2 {{do you want to add a stub?}} {{30-30=\nsubscript<Value>(storageKeyPath path: KeyPath<<#Base#>, Value>) -> Value { get { <#code#> \} \}}}
507
+
// expected-note@-2 {{do you want to add a stub?}} {{33-33=\nsubscript<Value>(storageKeyPath path: KeyPath<<#Base#>, Value>) -> Value { get { <#code#> \} \}}}
// expected-error@-1 {{type wrapper type 'MissingWritable' does not contain a required writable subscript}}
474
-
// expected-note@-2 {{do you want to add a stub?}} {{30-30=\nsubscript<Value>(storageKeyPath path: WritableKeyPath<<#Base#>, Value>) -> Value { get { <#code#> \} set { <#code#> \} \}}}
520
+
// expected-note@-2 {{do you want to add a stub?}} {{33-33=\nsubscript<Value>(storageKeyPath path: WritableKeyPath<<#Base#>, Value>) -> Value { get { <#code#> \} set { <#code#> \} \}}}
0 commit comments