-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Closed
Labels
A-tytype system / type inference / traits / method resolutiontype system / type inference / traits / method resolution
Description
We currently don't complete or infer slice method calls on arrays:
fn test() {
let arr = [1, 2, 3];
arr.len(); // doesn't work
}These work because Rust performs (only) unsized coercions on method call receiver, so [i32; 3] gets automatically coerced to [i32]. We have some support for these coercions, but don't perform them for method call receivers yet (I wasn't even aware that this was happening until I started wondering where these array methods come from 🙂 ). Implementing this will require some care, since method resolution is already quite complicated.
Metadata
Metadata
Assignees
Labels
A-tytype system / type inference / traits / method resolutiontype system / type inference / traits / method resolution