You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
class example {
let x: int;
new() {
self.x = 1;
}
new(x_: int) {
self.x = x_;
}
}
fn main(_args: [str]) {
let e: example = example();
}
Glenn-Willens-MacBook-Pro:rust gwillen$ rustc classes.rs
classes.rs:29:19: 29:29 error: this function takes 1 parameter but 0 parameters were supplied
classes.rs:29 let x: example = example();
^~~~~~~~~~
The compiler will let you give a class multiple constructors, and compiles it without error, but throws away all except the last one.
The text was updated successfully, but these errors were encountered:
Oh, and methods. And with fields it's not silent, but I can make it produce some bizarre errors, including an LLVM assert. Assuming this is all probably related.
Update Rust toolchain from nightly-2023-10-16 to nightly-2023-10-17
without any other source changes.
This is an automatically generated pull request. If any of the CI checks
fail, manual intervention is required. In such a case, review the
changes at https://github.com/rust-lang/rust from
rust-lang@42b1224
up to
rust-lang@49691b1.
The compiler will let you give a class multiple constructors, and compiles it without error, but throws away all except the last one.
The text was updated successfully, but these errors were encountered: