Automatic dereferencing is removed (#20531)
This commit is contained in:
parent
b8def03575
commit
d954e698b3
8 changed files with 18 additions and 104 deletions
|
|
@ -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
|
||||
=================
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue