Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

void type allowed in type definitions, use leads to compiler error #19335

Open
SirOlaf opened this issue Jan 6, 2022 · 0 comments
Open

void type allowed in type definitions, use leads to compiler error #19335

SirOlaf opened this issue Jan 6, 2022 · 0 comments

Comments

@SirOlaf
Copy link
Contributor

SirOlaf commented Jan 6, 2022

For some reason it is possible to use the void type for object fields. It is impossible to initialize, but using it as a type on var works. An attempt to use it will result in a compiler error.

Example:

type
  MyType = object
    a: void

var o: MyType
o.a

Output:

Error: internal error: genRecordField 3 MyType
@SirOlaf SirOlaf changed the title void type allowed in type definitions void type allowed in type definitions, use leads to compiler crash Oct 20, 2022
@SirOlaf SirOlaf changed the title void type allowed in type definitions, use leads to compiler crash void type allowed in type definitions, use leads to compiler error Oct 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant