Skip to content

Commit 1468d0e

Browse files
authored
Merge pull request #42387 from apple/changelog-formatting-fixes
Misc formatting fixes and tweaks for CHANGELOG
2 parents 01c295d + e6ea841 commit 1468d0e

File tree

1 file changed

+33
-17
lines changed

1 file changed

+33
-17
lines changed

CHANGELOG.md

Lines changed: 33 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ _**Note:** This is in reverse chronological order, so newer entries are added to
330330

331331
* [SE-0328][]:
332332

333-
Opaque types (expressed with 'some') can now be used in structural positions
333+
Opaque types (expressed with `some`) can now be used in structural positions
334334
within a result type, including having multiple opaque types in the same
335335
result. For example:
336336

@@ -942,7 +942,7 @@ Swift 5.5
942942
}
943943
```
944944

945-
* The 'lazy' keyword now works in local contexts, making the following valid:
945+
* The `lazy` keyword now works in local contexts, making the following valid:
946946

947947
```swift
948948
func test(useIt: Bool) {
@@ -2901,7 +2901,7 @@ Swift 3.0
29012901

29022902
* [SE-0101][]:
29032903

2904-
The functions `sizeof()`, `strideof()`, and `alignof()` have been removed.
2904+
The functions `sizeof()`, `strideof()`, and `alignof()` have been removed.
29052905
Memory layout properties for a type `T` are now spelled
29062906
`MemoryLayout<T>.size`, `MemoryLayout<T>.stride`, and
29072907
`MemoryLayout<T>.alignment`, respectively.
@@ -2943,7 +2943,7 @@ Swift 3.0
29432943

29442944
* [SE-0124][]:
29452945

2946-
Initializers on `Int` and `UInt` that accept an `ObjectIdentifier` must now use an explicit `bitPattern` label.
2946+
Initializers on `Int` and `UInt` that accept an `ObjectIdentifier` must now use an explicit `bitPattern` label.
29472947

29482948
```swift
29492949
let x: ObjectIdentifier = ...
@@ -3199,7 +3199,7 @@ using the `.dynamicType` member to retrieve the type of an expression should mig
31993199
didFailToRegisterForRemoteNotificationsWithError error: NSError)
32003200
```
32013201

3202-
Now it accepts an `Error` argument:
3202+
Now it accepts an `Error` argument:
32033203

32043204
```swift
32053205
optional func application(_ application: UIApplication,
@@ -3422,7 +3422,7 @@ using the `.dynamicType` member to retrieve the type of an expression should mig
34223422
foo/* comment */! // no longer works
34233423
```
34243424

3425-
Parse errors resulting from this change can be resolved by moving the comment outside the expression.
3425+
Parse errors resulting from this change can be resolved by moving the comment outside the expression.
34263426

34273427
* [SE-0031][]:
34283428

@@ -3483,7 +3483,7 @@ using the `.dynamicType` member to retrieve the type of an expression should mig
34833483
Attributes change from using `=` in parameters lists
34843484
to using `:`, aligning with function call syntax.
34853485

3486-
```
3486+
```swift
34873487
// before
34883488
@available(*, unavailable, renamed="MyRenamedProtocol")
34893489

@@ -3524,13 +3524,13 @@ using the `.dynamicType` member to retrieve the type of an expression should mig
35243524

35253525
Curried function syntax (with successive parenthesized groups of arguments) is removed, and now produces a compile-time error. Use chained functional return types instead.
35263526

3527-
```
3528-
// Before
3529-
public func project(function f: FunctionType)(p0: CGPoint, p1: CGPoint)(x: CGFloat) -> CGPoint
3527+
```swift
3528+
// Before
3529+
public func project(function f: FunctionType)(p0: CGPoint, p1: CGPoint)(x: CGFloat) -> CGPoint
35303530

3531-
// After
3532-
public func project(function f: FunctionType) -> (p0: CGPoint, p1: CGPoint) -> (x: CGFloat) -> CGPoint
3533-
```
3531+
// After
3532+
public func project(function f: FunctionType) -> (p0: CGPoint, p1: CGPoint) -> (x: CGFloat) -> CGPoint
3533+
```
35343534

35353535
* Generic signatures can now contain superclass requirements with generic parameter types, for example:
35363536

@@ -4877,11 +4877,15 @@ Swift 1.2
48774877
* The `@autoclosure` attribute is now an attribute on a parameter, not an
48784878
attribute on the parameter's type.
48794879

4880-
Where before you might have used:
4880+
Where before you might have used
48814881

48824882
```swift
48834883
func assert(predicate : @autoclosure () -> Bool) {...}
4884-
you now write this as:
4884+
```
4885+
4886+
you now write this as
4887+
4888+
```swift
48854889
func assert(@autoclosure predicate : () -> Bool) {...}
48864890
```
48874891

@@ -4923,7 +4927,11 @@ Swift 1.2
49234927
// redeclares Objective-C method
49244928
//'setProperty:'
49254929
}
4930+
```
4931+
49264932
Similar checking applies to accidental overrides in the Objective-C runtime:
4933+
4934+
```swift
49274935
class B : NSObject {
49284936
func method(arg: String) { } // note: overridden declaration
49294937
// here has type '(String) -> ()'
@@ -4934,7 +4942,11 @@ Swift 1.2
49344942
// selector 'method:' has incompatible
49354943
// type '([String]) -> ()'
49364944
}
4945+
```
4946+
49374947
as well as protocol conformances:
4948+
4949+
```swift
49384950
class MyDelegate : NSObject, NSURLSessionDelegate {
49394951
func URLSession(session: NSURLSession, didBecomeInvalidWithError:
49404952
Bool){ } // error: Objective-C method 'URLSession:didBecomeInvalidWithError:'
@@ -5022,13 +5034,17 @@ Swift 1.2
50225034
that used `unsafeBitCast` as a workaround for this issue can be written to
50235035
use the raw value initializer.
50245036

5025-
For example:
5037+
For example,
50265038

50275039
```swift
50285040
let animationCurve =
50295041
unsafeBitCast(userInfo[UIKeyboardAnimationCurveUserInfoKey].integerValue,
50305042
UIViewAnimationCurve.self)
5031-
can now be written instead as:
5043+
```
5044+
5045+
can now be written instead as
5046+
5047+
```swift
50325048
let animationCurve = UIViewAnimationCurve(rawValue:
50335049
userInfo[UIKeyboardAnimationCurveUserInfoKey].integerValue)!
50345050
```

0 commit comments

Comments
 (0)