Skip to content

Commit 72974a0

Browse files
Merge pull request #35344 from xAlien95/patch-1
[Changelog] Tweak code snippets
2 parents c8cd24a + 84ab340 commit 72974a0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

CHANGELOG.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,7 @@ Swift 5.1
526526
Duplicate tuple element labels are no longer allowed, because it leads
527527
to incorrect behavior. For example:
528528

529-
```
529+
```swift
530530
let dupLabels: (foo: Int, foo: Int) = (foo: 1, foo: 2)
531531

532532
enum Foo { case bar(x: Int, x: Int) }
@@ -538,7 +538,7 @@ Swift 5.1
538538
Note: You can still use duplicate argument labels when declaring functions and
539539
subscripts, as long as the internal parameter names are different. For example:
540540

541-
```
541+
```swift
542542
func foo(bar x: Int, bar y: Int) {}
543543
subscript(a x: Int, a y: Int) -> Int {}
544544
```
@@ -548,7 +548,7 @@ Swift 5.1
548548
Functions can now hide their concrete return type by declaring what protocols
549549
it conforms to instead of specifying the exact return type:
550550

551-
```
551+
```swift
552552
func makeMeACollection() -> some Collection {
553553
return [1, 2, 3]
554554
}
@@ -6755,7 +6755,7 @@ Swift 1.0
67556755

67566756
* A `map` method with the semantics of Haskell's `fmap` was added to
67576757
`Array<T>`. Map applies a function `f: T->U` to the values stored in
6758-
the array and returns an Array<U>. So,
6758+
the array and returns an `Array<U>`. So,
67596759

67606760
```swift
67616761
(swift) func names(x: Int[]) -> String[] {

0 commit comments

Comments
 (0)