Skip to content

Commit

Permalink
clarify distinct pointer type nil change (nim-lang#20376)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
metagn and Varriount authored Sep 20, 2022
1 parent 08c02f0 commit 3dc3026
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,15 @@
- `nimPreviewDotLikeOps` is going to be removed or deprecated.

- 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
`type Foo = object {.final.}`, and `type Foo {.final.} [T] = object`.

Expand Down

0 comments on commit 3dc3026

Please sign in to comment.