Fix #17509: Continue instead of return with unfinished generics (#22563)

Close #17509

Current knowledge:
- delaying cache fixes the issue
- changing return of `if inst.len < key.len:` in `searchInstTypes` to
`continue` fixes the issue. With return the broken types are also cached
over and over

Related issues are completely unaffected as of now, so there must be
something deeper.

I am also still trying to find the true cause, so feel free to ignore
for now

---------

Co-authored-by: SirOlaf <>
This commit is contained in:
SirOlaf
2023-09-07 05:46:45 +02:00
committed by GitHub
parent a4df44d9fb
commit ee4a219012
2 changed files with 27 additions and 1 deletions

View File

@@ -45,7 +45,8 @@ proc searchInstTypes*(g: ModuleGraph; key: PType): PType =
# XXX: This happens for prematurely cached
# types such as Channel[empty]. Why?
# See the notes for PActor in handleGenericInvocation
return
# if this is return the same type gets cached more than it needs to
continue
if not sameFlags(inst, key):
continue