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

check kinds in lowering #16

Closed
nikomatsakis opened this issue Jan 27, 2017 · 0 comments
Closed

check kinds in lowering #16

nikomatsakis opened this issue Jan 27, 2017 · 0 comments

Comments

@nikomatsakis
Copy link
Contributor

Currently we check that when you instantiate a struct or trait you supply the right number of parameters, but we don't check that they have the right kind (i.e., type vs lifetime). I added an (ignored) test check_struct_kinds that demonstrates this. It'd be nice to fix this.

To fix it, one would go into chalk-rust/src/lower/mod.rs and look for places where we check the number of parameters, e.g.:

        if args.len() != info.addl_parameter_kinds.len() {
            bail!("wrong number of parameters for associated type (expected {}, got {})",
                  info.addl_parameter_kinds.len(), args.len())
        }

and adapt those to also check that the kinds in args match the kinds of info.addl_parameter_kinds (in that particular case).

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

No branches or pull requests

1 participant