Intellij-rust: functions returning Self confuse intellij

Created on 31 Jul 2017  路  1Comment  路  Source: intellij-rust/intellij-rust

    impl SApp {
        pub fn new() -> Self { SApp {  } }
        pub fn version(self) -> Self { self }
        pub fn get_name(&self) -> &str { "me" }
    }
    let m = SApp::new().version();
    println!("{:?}", m.get_name());

intellij doesn't know the type of 'm'. If 'new' and 'version' are changed to return 'SApp' everything works fine.

Most helpful comment

I'm just working on this:)

>All comments

I'm just working on this:)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Juici picture Juici  路  3Comments

evanjpw picture evanjpw  路  3Comments

joslopgar picture joslopgar  路  3Comments

SomeoneToIgnore picture SomeoneToIgnore  路  3Comments

stonenice picture stonenice  路  3Comments