converter-page
converter-page copied to clipboard
Default methods are incorrectly translated
I tried to translate a Java interface with a default method to Rust:
public interface Example {
default int example(int a1) {
return a1;
}
}
But the converter's output has a syntax error: the method starts with fn default example
.
pub trait Example {
fn default example(&self, a1: i32) -> i32 {
return a1;
}
}
If I remove the default
keyword, it no longer has a syntax error.
pub trait Example {
fn example(&self, a1: i32) -> i32 {
return a1;
}
}