diff options
author | metagn <metagngn@gmail.com> | 2024-09-13 12:08:22 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-13 11:08:22 +0200 |
commit | 61e04ba0ed4b8c6567f4cfd5c48c2c2439c62371 (patch) | |
tree | bb7628b388a52c676f1b66bad611a2b72465c861 /changelog.md | |
parent | 793cee4de1934fd1f6271cf5fed46f01c5abb19b (diff) | |
download | Nim-61e04ba0ed4b8c6567f4cfd5c48c2c2439c62371.tar.gz |
fix calls to untyped arbitrary expressions in generics (#24100)
fixes #24099 If an arbitrary expression without a proc type (in this case `tyFromExpr`) is called, the compiler [passes it to overload resolution](https://github.com/nim-lang/Nim/blob/793cee4de1934fd1f6271cf5fed46f01c5abb19b/compiler/semexprs.nim#L1223). But overload resolution also can't handle arbitrary expressions and treats them as not participating at all, matching with the state `csEmpty`. The compiler checks for this and gives an "identifier expected" error. Instead, now if we are in a generic context and an arbitrary expression call matched with `csEmpty`, we now return `csNoMatch` so that `semResolvedCall` can leave it untyped as appropriate. The expression flag `efNoDiagnostics` is replaced with this check. It's not checked anywhere else and the only place that uses it is `handleCaseStmtMacro`. Replacing it with `efNoUndeclared`, we just get `csEmpty` instead of `csNoMatch`, which is handled the same way here. So `efNoDiagnostics` is now removed and `efNoUndeclared` is used instead.
Diffstat (limited to 'changelog.md')
0 files changed, 0 insertions, 0 deletions