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] Inferred parameter bug when nesting parameters #2845

Closed
nmsmith opened this issue May 27, 2024 · 0 comments
Closed

[BUG] Inferred parameter bug when nesting parameters #2845

nmsmith opened this issue May 27, 2024 · 0 comments
Labels
bug Something isn't working mojo-repo Tag all issues with this label

Comments

@nmsmith
Copy link
Contributor

nmsmith commented May 27, 2024

Bug description

The below code snippet generates the following error message:
error: 'Bar' parameter #2 has 'Foo[?]' type, but value has type 'Foo[x]'

I believe this signature is well-typed, so I assume this is a compiler bug.

@Mogball, I expect this bug is for you.

Steps to reproduce

@value
struct Foo[x: Int]:
    pass


@value
struct Bar[x: Int, //, y: Int, foo: Foo[x]]:
    pass


fn test(arg: Bar[5, _]) -> Bar[5, arg.foo]:
    return Bar[5, arg.foo]()

System information

Mojo nightly 2024.5.2605 (9c328b12)
@nmsmith nmsmith added bug Something isn't working mojo-repo Tag all issues with this label labels May 27, 2024
@linear linear bot closed this as completed Jun 19, 2024
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-repo Tag all issues with this label
Projects
None yet
Development

No branches or pull requests

1 participant