Skip to content

fixes #25908; resolves lent enum disambiguation#25929

Open
ringabout wants to merge 2 commits into
develfrom
pr_jdn
Open

fixes #25908; resolves lent enum disambiguation#25929
ringabout wants to merge 2 commits into
develfrom
pr_jdn

Conversation

@ringabout

Copy link
Copy Markdown
Member

fixes #25908

When an enum identifier is resolved as an nkSymChoice, one of the
candidates may come from a loop-local view and carry tyVar or tyLent.

Enum disambiguation should compare the underlying enum type only.
Otherwise a pure-enum field can win incorrectly even though the intended
symbol is already present in the choice set.

Keep the includePureEnum lookup path for enum-typed expectations so
#23976 still works, but normalize var/lent only at the symchoice
selection point.

@Araq Araq added the merge_when_passes_CI mergeable once green label Jun 22, 2026
@ringabout

Copy link
Copy Markdown
Member Author
/Users/runner/.cache/nim/all_tests_d/@nchronos-4.2.2-3a4c9477df8cef20a04e4f1b54a2d74fdfc2a3d0@schronos@sstreams@stlsstream.nim.c:6200:54: error: incompatible function pointer types passing 'void (void *, void *, size_t)' (aka 'void (void *, void *, unsigned long)') to parameter of type 'tyProc__OCRfNMELwE9cfpOW8j7MgNA' (aka 'void (*)(void *, const void *, unsigned long)') [-Wincompatible-function-pointer-types]
          nimln_(718);setdest_u0__pkgZbearsslZpem(((&ctx_1)), itemAppend_u0__pkgZchronosZstreamsZtlsstream, ((void*) (pctx_1)));
                                                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  /Users/runner/.cache/nim/all_tests_d/@nchronos-4.2.2-3a4c9477df8cef20a04e4f1b54a2d74fdfc2a3d0@schronos@sstreams@stlsstream.nim.c:1010:124: note: passing argument to parameter 'dest_p1' here
  N_LIB_PRIVATE N_NIMCALL(void, setdest_u0__pkgZbearsslZpem)(br_pem_decoder_context* ctx_p0, tyProc__OCRfNMELwE9cfpOW8j7MgNA dest_p1, void* destCtx_p2);

pre-existing CI failures

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge_when_passes_CI mergeable once green

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Regression from 2.2.10 to version-2-2/devel with {.pure.} enum and generic inline iterator

2 participants