-
Notifications
You must be signed in to change notification settings - Fork 13.9k
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsE-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.Call for participation: An issue has been fixed and does not reproduce, but no test has been added.
Description
As the title says, the parenthesised part sometimes prints backwards. At least, I've found one case where it does - when one of the operands is a reference provided by an iterator:
Test code:
fn main() {
let i: [int, ..5] = [0, ..5];
let n = &i[0];
// Error prints correctly
1 + n;
// Error prints backwards
for v in i.iter() {
1 + v;
}
}
Result:
test.rs:8:6: 8:7 error: mismatched types: expected `<generic integer #3>`
but found `&int` (expected integral variable but found &-ptr)
test.rs:8 1 + n;
^
test.rs:12:7: 12:8 error: mismatched types: expected `<generic integer #4>`
but found `&int` (expected &-ptr but found integral variable)
test.rs:12 1 + v;
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsE-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.Call for participation: An issue has been fixed and does not reproduce, but no test has been added.
Type
Projects
Milestone
Relationships
Development
Select code repository
Activity
ben0x539 commentedon Jan 28, 2014
Slightly more minimal test case:
Weird~
nmsmith commentedon Jan 28, 2014
Ah, that's interesting. Then it seems the problem might be related to type inference. I'm not familiar enough with the compiler internals to investigate it myself though.