Skip to content
New issue

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

Default methods are incorrectly translated #7

Open
jarble opened this issue Jul 16, 2021 · 0 comments
Open

Default methods are incorrectly translated #7

jarble opened this issue Jul 16, 2021 · 0 comments

Comments

@jarble
Copy link

jarble commented Jul 16, 2021

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;
    }
} 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant