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
SomeStruct::new()
Type-associated functions can currently be called by using a . but not a ::. For example:
.
::
struct Rectangle: h: u256 w: u256 pub fn square(x: u256) -> Rectangle: return Rectangle(h=x, w=x) pub fn area(self) -> u256: return self.h * self.w fn do_square_things(): let s: Rectangle = Rectangle::square(10) assert s.area() == 100
The Rectangle::square(10) call above panics with something like
Rectangle::square(10)
thread 'struct_fn' panicked at 'not yet implemented: cannot access items in types yet', crates/analyzer/src/namespace/items.rs:106:30
changing it to Rectangle.square(10) works. This syntax should be disabled, and :: should be fixed.
Rectangle.square(10)
The text was updated successfully, but these errors were encountered:
Whoops, duplicate of #241
Sorry, something went wrong.
No branches or pull requests
What is wrong?
Type-associated functions can currently be called by using a
.
but not a::
. For example:The
Rectangle::square(10)
call above panics with something likechanging it to
Rectangle.square(10)
works. This syntax should be disabled, and::
should be fixed.How can it be fixed
🧑💻
The text was updated successfully, but these errors were encountered: