clarinet icon indicating copy to clipboard operation
clarinet copied to clipboard

Incorrect "Read-Only" Warning in VSCode Plug-In

Open gregorycoppola opened this issue 3 years ago • 2 comments

Description of the error

image

I'm told I'm using a writing operation when creating a define-read-only function.

Steps to Reproduce

  • I opened the files hyperchains.clar from the hirosystems/stacks-hyperchains repo in VSCode with the Hiro clarinet plug-in
  • I went to add a new define-read-only function.
  • I get this warning

Additional Notes

The actual clarinet test that calls this contracts runs fine. I even had the ts code print the value:

$ clarinet test
Running file:///home/greg/subnet6/core-contracts/tests/hyperchains/hyperchains_test.ts
{ count: { session_id: 1, result: "(ok 5)", events: [] } }
* Ensure that block can be committed by subnet miner ... ok (9ms)
* Ensure that user can deposit NFT & miner can withdraw it ... ok (58ms)
* Ensure that user can deposit FT & miner can withdraw it ... ok (66ms)

test result: ok. 3 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out (1024ms)

gregorycoppola avatar May 31 '22 21:05 gregorycoppola

I can't reproduce this. @gregorycoppola, do you get that error when you run clarinet check or only in VS Code? Which version of clarinet are you using?

obycode avatar Jun 01 '22 13:06 obycode

Is it possible that there was previously a writing operation on this line and the old error was not properly cleared? I think I have seen that happen before.

obycode avatar Jun 07 '22 19:06 obycode

@hugocaillard could we please test this snippet and close this issue if you're unable to reproduce? Thanks!

lgalabru avatar Oct 06 '22 11:10 lgalabru

Can't reproduce Agreed with @obycode's previous message, what can happen is that the extensions crashes and previous diagnostics don't get cleaned up. We fixed a few of the crashes root causes recently

hugoclrd avatar Oct 06 '22 12:10 hugoclrd