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

[DSLX] Improve type handling in parametrics #986

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

mtdudek
Copy link
Contributor

@mtdudek mtdudek commented May 26, 2023

Some buildins like zero! did not work with
parametric structs and with arrays of structs.

ParseParametrics returns TypeAnnotation only if
token is a buildin type. In all other cases
identifiers are expected to resolve to TypeRef or
constant values.

This commit changes ParseParametrics to allow for
parametric structs and struct arrays types.
This change only extends Parser capabiliteis.

Signed-off-by: Maciej Dudek mdudek@antmicro.com

This commit adds tests to improve
`zero!<>()` coverage. Some tests are disabled
(GH-google#984)

Signed-off-by: Maciej Dudek <mdudek@antmicro.com>
Some buildins like `zero!` did not work with
parametric structs and with arrays of structs.

ParseParametrics returns TypeAnnotation only if
token is a buildin type. In all other cases
identifiers are expected to resolve to TypeRef or
constant values.

This commit changes ParseParametrics to allow for
parametric structs and struct arrays types.
This change only extends Parser capabiliteis.

Signed-off-by: Maciej Dudek <mdudek@antmicro.com>
@proppy
Copy link
Member

proppy commented Jun 13, 2023

is that ready to review? is that blocking #994?

@proppy
Copy link
Member

proppy commented Apr 3, 2024

@tmichalak can you confirm if this is still needed?

@tmichalak
Copy link

@tmichalak can you confirm if this is still needed?

So, the zero! macro is still limited and you cannot use parametric structs with it. Currently, as a workaround you need to define a type alias that renames a parametric type to a new one without explicit parameters, therefore having a more advanced zero! macro would be useful.

@proppy
Copy link
Member

proppy commented Apr 3, 2024

the zero! macro is still limited and you cannot use parametric structs with it.

is that already captured as an issue?

@tmichalak
Copy link

the zero! macro is still limited and you cannot use parametric structs with it.

is that already captured as an issue?

Yes, there is this one, but I guess that looking at the comment and workaround we might need to stick to the workaround for the time being.

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 this pull request may close these issues.

3 participants