Files
Nim/compiler
metagn 480e98c479 resolve unambiguous enum symchoices from local scope, error on rest (#22606)
fixes #22598, properly fixes #21887 and fixes test case issue number

When an enum field sym choice has to choose a type, check if its name is
ambiguous in the local scope, then check if the first symbol found in
the local scope is the first symbol in the sym choice. If so, choose
that symbol. Otherwise, give an ambiguous identifier error.

The dependence on the local scope implies this will always give
ambiguity errors for unpicked enum symchoices from generics and
templates and macros from other scopes. We can change `not
isAmbiguous(...) and foundSym == first` to `not (isAmbiguous(...) and
foundSym == first)` to make it so they never give ambiguity errors, and
always pick the first symbol in the symchoice. I can do this if this is
preferred, but no code from CI seems affected.
2023-09-03 13:59:03 +02:00
..
2022-09-27 10:57:47 +02:00
2017-01-07 22:35:09 +01:00
2023-08-19 21:04:25 +02:00
2023-08-25 06:48:08 +02:00
2023-05-06 21:27:28 +02:00
2023-08-06 14:26:21 +02:00
2021-01-12 09:36:51 +01:00
2023-08-06 14:26:21 +02:00
2022-03-23 20:34:53 +01:00
2023-07-02 22:36:05 +02:00
2023-08-25 06:48:08 +02:00
2023-08-25 06:48:08 +02:00
2023-08-06 14:26:21 +02:00
2023-08-25 06:48:08 +02:00

Nim Compiler

  • This directory contains the Nim compiler written in Nim.
  • Note that this code has been translated from a bootstrapping version written in Pascal.
  • So the code is not a poster child of good Nim code.

See Internals of the Nim Compiler for more information.