expected &someEnum but found an enum or structure pattern is misleading #7867
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
E-needs-test
Call for participation: An issue has been fixed and does not reproduce, but no test has been added.
I've had a hard time learning
match
because this error message is misleading.Steps to reproduce:
Actual:
Expected:
or more generally
expected &someEnum but found enum T
Great work on the rest of the error message, BTW. I like the line number and arrow.
I eventually figured out that Number is an enum value of extra::json::Json and the fix is:
The text was updated successfully, but these errors were encountered: