Error output regression: spurious integer inference error that only occurs if another error occurs #93450
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
P-medium
Medium priority
regression-from-stable-to-stable
Performance or correctness regression from one stable version to another.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
I was just going through my FizzBuzz article as I do every year or so to update compiler error messages and make any related changes necessary, and came across a regression in error output for Figure 3.
Given the following code:
This is the output in 1.57.0 (and it’s been just the one error that we now call E0308 right from the outset):
But the output in 1.58.0 and in currently nightly adds another error, E0283:
The integer type inference error is spurious, because if you resolve the if/else type mismatch (e.g. tack on
.to_string()
on the other branches), it also vanishes (resolved to the default of i32, I presume).The text was updated successfully, but these errors were encountered: