clarify distinct pointer type nil change (#20376)
* clarify distinct pointer type `nil` change * Update changelog.md [skip ci] Co-authored-by: Clay Sweetser <Varriount@users.noreply.github.com> * remove extra quote [skip ci] Co-authored-by: Clay Sweetser <Varriount@users.noreply.github.com>
This commit is contained in:
parent
08c02f0236
commit
3dc302662e
1 changed files with 9 additions and 1 deletions
10
changelog.md
10
changelog.md
|
|
@ -29,7 +29,15 @@
|
||||||
- `nimPreviewDotLikeOps` is going to be removed or deprecated.
|
- `nimPreviewDotLikeOps` is going to be removed or deprecated.
|
||||||
|
|
||||||
- The `{.this.}` pragma, deprecated since 0.19, has been removed.
|
- The `{.this.}` pragma, deprecated since 0.19, has been removed.
|
||||||
- `nil` is no longer a valid value for distinct pointer types.
|
- `nil` literals can no longer be directly assigned to variables or fields of `distinct` pointer types. They must be converted instead.
|
||||||
|
```nim
|
||||||
|
type Foo = distinct ptr int
|
||||||
|
|
||||||
|
# Before:
|
||||||
|
var x: Foo = nil
|
||||||
|
# After:
|
||||||
|
var x: Foo = Foo(nil)
|
||||||
|
```
|
||||||
- Removed two type pragma syntaxes deprecated since 0.20, namely
|
- Removed two type pragma syntaxes deprecated since 0.20, namely
|
||||||
`type Foo = object {.final.}`, and `type Foo {.final.} [T] = object`.
|
`type Foo = object {.final.}`, and `type Foo {.final.} [T] = object`.
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue