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
V version: OS: https://vlang.io/play
What did you do?
struct Vec { x int y int } fn (a Vec) str() string { return '{$a.x, $a.y}' } fn (a Vec) + (b Vec) Vec { return a+b } fn (a Vec) - (b Vec) Vec { return Vec { a.x - b.x, a.y - b.y } } fn main() { a := Vec{2, 3} b := Vec{4, 5} println(a + b) println(a - b) }
error:
You just found a bug. V can't compile this program, but it should. Please create a GitHub issue.
The text was updated successfully, but these errors were encountered:
fn (a Vec) + (b Vec) Vec { return a+b }
The implementation is an infinite recursion, I'm guessing the mistake is there.
Not a very helpful error message, of course.
Sorry, something went wrong.
It compiles on V 0.1.24 938f27e. It crashes due to stack overflow just like expected.
Please reopen this issue if you were not satisfied by this.
new error in https://vlang.io/play
.str() methods must be declared as public 4| }
No branches or pull requests
V version:
OS:
https://vlang.io/play
What did you do?
error:
The text was updated successfully, but these errors were encountered: