Skip to content

Method calls don't autoderef #2212

Closed
Closed
@brson

Description

@brson

Field access does.

impl i for int {
    fn val() -> str { "wut" }
}

fn main() {
    let j = @{
        val: 10
    };
    // This autoderefs
    assert j.val == 10;

    let i = @10;
    // This does not
    assert i.val() == "wut";
}
../src/test/run-pass/method-autoderef.rs:12:11: 12:16 error: attempted access of field val on type @int, but no public field or method with that name was found
../src/test/run-pass/method-autoderef.rs:12     assert i.val() == "wut";

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions