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

[BUG] Parser crash when using struct member alias without specifying struct parameter #253

Closed
DayDun opened this issue May 24, 2023 · 1 comment
Assignees
Labels
bug Something isn't working mojo Issues that are related to mojo mojo-repo Tag all issues with this label

Comments

@DayDun
Copy link

DayDun commented May 24, 2023

Bug Description

@value
@register_passable
struct Struct[n: Int]:
    alias Alias = Struct[1]()

alias x = Struct.Alias
error: The Mojo REPL has crashed and attempted recovery. If the REPL behaves inconsistently, please restart to ensure correct behavior.

Does not crash if you specify Struct[1].Alias.

Expected behavior would be to either emit an error indicating that a parameter needs to be specified. Or maybe allow no parameters if the alias doesn't depend on any?

@DayDun DayDun added the bug Something isn't working label May 24, 2023
@Mogball
Copy link

Mogball commented May 24, 2023

Thanks for filing! This looks like a parser verification hole. The code you've shared should throw an error instead of crashing.

@Mogball Mogball changed the title [BUG] REPL crash when using member alias without specifying parameter [BUG] Parser crash when using struct member alias without specifying struct parameter May 24, 2023
@ematejska ematejska added the mojo-repo Tag all issues with this label label May 7, 2024
@ematejska ematejska added the mojo Issues that are related to mojo label Feb 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working mojo Issues that are related to mojo mojo-repo Tag all issues with this label
Projects
None yet
Development

No branches or pull requests

4 participants