File tree Expand file tree Collapse file tree 1 file changed +12
-12
lines changed
Expand file tree Collapse file tree 1 file changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -8,21 +8,21 @@ Swift 5.5
88
99* Type names are no longer allowed as an argument to a subscript parameter that expects a metatype type
1010
11- ``` swift
12- struct MyValue {
13- }
11+ ``` swift
12+ struct MyValue {
13+ }
1414
15- struct MyStruct {
16- subscript (a : MyValue.Type ) -> Int { get { ... } }
17- }
15+ struct MyStruct {
16+ subscript (a : MyValue.Type ) -> Int { get { ... } }
17+ }
1818
19- func test (obj : MyStruct) {
20- let _ = obj[MyValue]
21- }
22- ```
19+ func test (obj : MyStruct) {
20+ let _ = obj[MyValue]
21+ }
22+ ```
2323
24- Accepting subscripts with ` MyValue ` as an argument was an oversight because ` MyValue ` requires explicit ` .self `
25- to reference its metatype, so correct syntax would be to use ` obj[MyValue.self] ` .
24+ Accepting subscripts with ` MyValue ` as an argument was an oversight because ` MyValue ` requires explicit ` .self `
25+ to reference its metatype, so correct syntax would be to use ` obj[MyValue.self] ` .
2626
2727* [ SE-0310] [ ] :
2828
You can’t perform that action at this time.
0 commit comments