Skip to content

Commit 27943ba

Browse files
Fix type inference example in "Creating an Empty Array"
Updated the array initialization example to demonstrate type inference (var someInts = [Int]()) for consistency with other sections in the guide, such as Sets and Dictionaries. This change aligns the code example with the accompanying explanatory text.
1 parent fe0121d commit 27943ba

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

TSPL.docc/LanguageGuide/CollectionTypes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ print("someInts is of type [Int] with \(someInts.count) items.")
8383
- test: `arraysEmpty`
8484
8585
```swifttest
86-
-> var someInts: [Int] = []
86+
-> var someInts = [Int]()
8787
-> print("someInts is of type [Int] with \(someInts.count) items.")
8888
<- someInts is of type [Int] with 0 items.
8989
```

0 commit comments

Comments
 (0)