Conversation
There was a problem hiding this comment.
Pull request overview
This pull request fixes issue #25508 where using void as a tuple field type causes an internal compiler error internal error: getTypeDescAux(tyVoid). The fix adds validation in the semantic analysis phase to reject void types as tuple field types before they reach code generation.
Changes:
- Added void field type validation in
semAnonTupleandsemTuplefunctions - Created test case to verify proper error messages for both named and anonymous tuples with void fields
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| tests/errmsgs/t25508.nim | Test case verifying void fields in tuples are rejected with clear error messages |
| compiler/semtypes.nim | Added void type checks in tuple semantic analysis to prevent internal errors during code generation |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
why disallow? why not treat it the same as if it appeared in a generic instantiation? |
|
It's buggy #19335 |
|
Yeah, I don't get it either... The other PR I merged allows |
|
The other PR allows generic voids for tuple fields. It may require codegen changes for a plain |
|
I will see whether I can fix it following #10144 |
|
The problem with Requires a switch |
fix #25508