Largely insufficient diagnostics with undefined decls in generics #20294
Labels
bug
Observed behavior contradicts documented or intended behavior
error message
This issue points out an error message that is unhelpful and should be improved.
Milestone
Zig Version
0.13.0
Steps to Reproduce and Observed Output
Compile the following code. Use
-freference-trace
is you like - it doesn't seem to change the results.The diagnostics says:
It is absolutely unclear what caused
ContainerA
to be used as a parameter toView()
. In a large or even medium codebase it might be impossible to find (unless the statement is literallyView(ContainerA)
, which is not necessarily the case).Now we can attempt to improve the diagnostics by uncommenting the two lines in the
View
function and compile again. The diagnostics now saysWe are one step further, but still have no information on where
ViewHost(ContainerA)
was instantiated.Expected Output
The error message's reference trace is expected to go all the way to the "root cause" position, which in both cases is the line in the
main
function.The text was updated successfully, but these errors were encountered: