Skip to content

Commit 2ffec63

Browse files
[Gardening] CHANGELOG: Add missing language modes and clean up some whitespace-only lines in 5.7 section
1 parent 1398760 commit 2ffec63

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

CHANGELOG.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,25 +55,29 @@ _**Note:** This is in reverse chronological order, so newer entries are added to
5555
* [SE-0350][]:
5656

5757
The standard library has a new `Regex<Output>` type.
58-
58+
5959
This type represents an _extended regular expression_, allowing more fluent
6060
string processing operations. A `Regex` may be created by
6161
[initialization from a string][SE-0355]:
62-
```
62+
63+
```swift
6364
let pattern = "a[bc]+" // matches "a" followed by one or more instances
6465
// of either "b" or "c"
6566
let regex = try! Regex(pattern)
6667
```
68+
6769
Or via a [regex literal][SE-0354]:
68-
```
70+
71+
```swift
6972
let regex = #/a[bc]+/#
7073
```
74+
7175
In Swift 6, `/` will also be supported as a delimiter for `Regex` literals.
7276
You can enable this mode in Swift 5.7 with the `-enable-bare-slash-regex`
7377
flag. Doing so will cause some existing expressions that use `/` as an
7478
operator to no longer compile; you can add parentheses or line breaks as a
7579
workaround.
76-
80+
7781
There are [new string-processing algorithms][SE-0357] that support
7882
`String`, `Regex` and arbitrary `Collection` types.
7983

@@ -165,7 +169,7 @@ _**Note:** This is in reverse chronological order, so newer entries are added to
165169
Protocols with primary associated types can now be used in existential types,
166170
enabling same-type constraints on those associated types.
167171

168-
```
172+
```swift
169173
let strings: any Collection<String> = [ "Hello" ]
170174
```
171175

@@ -508,12 +512,12 @@ _**Note:** This is in reverse chronological order, so newer entries are added to
508512
struct S {
509513
@available(macOS 99, *) // error: stored properties cannot be marked potentially unavailable with '@available'
510514
lazy var a: Int = 42
511-
515+
512516
@available(macOS 99, *) // error: stored properties cannot be marked potentially unavailable with '@available'
513517
@Wrapper var b: Int
514518
}
515519
```
516-
520+
517521
* The compiler now correctly emits warnings for more kinds of expressions where a protocol conformance is used and may be unavailable at runtime. Previously, member reference expressions and type erasing expressions that used potentially unavailable conformances were not diagnosed, leading to potential crashes at runtime.
518522

519523
```swift

0 commit comments

Comments
 (0)