* better procvar ambiguity errors, clean up after #20457 fixes #6359, fixes #13849 * only trigger on closedsymchoice again * new approach * add manual entry for ambiguous enums too * add indent [skip ci] * move to proc
This commit is contained in:
parent
b36f5119ae
commit
2449c37137
5 changed files with 76 additions and 36 deletions
|
|
@ -1365,6 +1365,23 @@ ambiguous, a static error will be produced.
|
|||
p value2
|
||||
```
|
||||
|
||||
In some cases, ambiguity of enums is resolved depending on the relation
|
||||
between the current scope and the scope the enums were defined in.
|
||||
|
||||
```nim
|
||||
# a.nim
|
||||
type Foo* = enum abc
|
||||
|
||||
# b.nim
|
||||
import a
|
||||
type Bar = enum abc
|
||||
echo abc is Bar # true
|
||||
|
||||
block:
|
||||
type Baz = enum abc
|
||||
echo abc is Baz # true
|
||||
```
|
||||
|
||||
To implement bit fields with enums see [Bit fields].
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue