We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Describe the bug Currently it seems that impl method only accept Self as the receiver type, should we support the concrete struct type as well?
To Reproduce
struct Params { a: u32, } impl Params { fn new(a: u32) -> Params { Params { a } } fn b(self: Params) -> u32 { self.a / u32:2 } } fn params() -> Params { Params::new(u32:42) } #[test] fn params_test() { let p = params(); assert_eq(p.b(), u32:21); }
produces the following error:
0023: fn params_test() { 0024: let p = params(); 0025: assert_eq(p.b(), u32:21); ~~~~~~~~~~~~~~~~~~~~~^^ ArgCountMismatchError: Expected 1 parameter(s) but got 0 arguments. 0026: }
Expected behavior
fn b(self: Params) -> u32 {
get aliased to:
fn b(self: Self) -> u32 {
The text was updated successfully, but these errors were encountered:
Let's check if this works in v2.
Sorry, something went wrong.
richmckeever
No branches or pull requests
Describe the bug
Currently it seems that impl method only accept Self as the receiver type, should we support the concrete struct type as well?
To Reproduce
produces the following error:
Expected behavior
get aliased to:
The text was updated successfully, but these errors were encountered: