Error for name is not marked 'pub' is misleading/incomplete #20461
Labels
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
Consider the following combination scenario:
Main.zig
:Point.zig
:PointCloud.zig
This produces the (in my opinion) misleading/incomplete error message
PointCloud.zig:1:34: error: 'Point2D' is not marked 'pub'
.Expected Output
The reason that I think it is misleading, is that the compiler knows the location where
Point
is defined and should suggest importing fromPoint.zig
. I realize that it may still be useful to report the fact thatPoint
is imported intoMain.zig
but is not markedpub
there, but it most situations you probably want to import from the original file.In my opinion, the expected output could read something like:
PointCloud.zig:1:34: error: The imported variable 'Point2D' at 'Main.zig:1.1' is not marked 'pub'. Consider importing the original definition at 'Point.zig:1:1'.
The text was updated successfully, but these errors were encountered: