dojoengine / dojo

Dojo is a toolchain for building provable games and autonomous worlds with Cairo
https://dojoengine.org
Apache License 2.0
384 stars 145 forks source link

Diagnostics not linking the code properly #2027

Open lambda-0x opened 4 weeks ago

lambda-0x commented 4 weeks ago

Describe the bug

$ sozo build

warn[E0001]: Unused variable. Consider ignoring by prefixing with `_`.
 --> /path/to/dojo/examples/spawn-and-move/src/actions.cairo:16:1
#[dojo::contract]
^***************^

To Reproduce simply add a unused variable in the code and build

Expected behavior should point to the correct line where issue occured.

lambda-0x commented 3 weeks ago

its working as expected until 0.7.0-alpha.3 and i am seeing this behaviour from 0.7.0-alpha.4 onwards.

lambda-0x commented 3 weeks ago

did a git bisect on it and the first commit that has the issue is e6146516d91fe5e91dc6ca1259b8699e40828e40

glihm commented 2 weeks ago

did a git bisect on it and the first commit that has the issue is e6146516d91fe5e91dc6ca1259b8699e40828e40

And to complete this, it is only happening on the #[dojo::contract] attribute. Others like #[dojo::model], #[dojo::interface] and #[dojo::event] are working as expected.

glihm commented 1 week ago

Seems like it is the case with all attributes. It is being investigated by Scarb team.