Automatic dereferencing is removed (#20531)

This commit is contained in:
ringabout 2022-10-10 21:02:23 +08:00 • committed by GitHub
commit d954e698b3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 18 additions and 104 deletions

View file

@ -1984,10 +1984,6 @@ dereferencing operations for reference types:
# no need to write n[].data; in fact n[].data is highly discouraged!
```
Automatic dereferencing can be performed for the first argument of a routine
call, but this is an experimental feature and is described [here](
manual_experimental.html#automatic-dereferencing).
In order to simplify structural type checking, recursive tuples are not valid:
```nim

View file

@ -286,29 +286,6 @@ scope. Therefore, the following will *fail to compile:*
This feature will likely be replaced with a better solution to remove
the need for forward declarations.
Automatic dereferencing
=======================
Automatic dereferencing is performed for the first argument of a routine call.
This feature has to be enabled via `{.experimental: "implicitDeref".}`:
```nim
{.experimental: "implicitDeref".}
type
NodeObj = object
# ...
Node = ref NodeObj
proc depth(x: NodeObj): int = ...
let n = Node()
echo n.depth
# no need to write n[].depth
```
Special Operators
=================