propagate efWantStmt in semWhen (#23400)

fixes #23399

The new case introduced in #21657 is triggered by `efWantStmt` but the
`when` statement doesn't normally propagate this flag, so propagate it
when the `semCheck` param in `semWhen` is true which happens when the
`when` statement is `efWhenStmt` anyway.

(cherry picked from commit fb6c805568)
This commit is contained in:
metagn
2024-03-14 13:23:09 +03:00
committed by narimiran
parent d112874078
commit 1ac5aa951d
2 changed files with 11 additions and 3 deletions

View File

@@ -13,3 +13,10 @@ proc foo() =
sequtils
foo()
# issue #23399
when isMainModule:
sequtils #[tt.Error
^ expression has no type: sequtils]#
discard