Incorrect warning: nonexistent __x variable is shadowed #476
Open
opened 2023-08-02 21:04:36 +09:00 by zxq9
·
12 comments
No Branch/Tag Specified
master
uw-aci
prh-docs-fix
uw-mldsa-crypto
uw-rename-fix-deps
bump_gmserialization
zomp
ceres
gh-pages
gh-485
dependabot/pip/dot-github/workflows/pygments-2.15.0
old_ceres
ghallak/split-typechecker
gh-400
new_ceres
loop-op
type-env
ghallak/229
option-force-msg
6.0.2
lima
call-fee
fix-ets
mergesort
lima-master-merge
optionally_generate_aci
changelog-update
make-return-reserved-word
radrow-patch-2
aens-subdomains
aens-at-full-node-ver
pt-166866806-claim-with-name-fee
extend-aci-interface
generalized_accounts_no_abi_move
roma
quickcheck-ci
v7.5.0
v7.4.0
v7.3.0
v7.2.1
v7.2.0
v7.1.0
v7.0.1
v7.0.0
v6.1.0
v6.0.2
v6.0.1
v6.0.0
v5.0.0
v4.3.0
v4.2.0
v4.1.0
v4.1.0-rc1
v4.0.0
v4.0.0-rc5
v4.0.0-rc4
v4.0.0-rc3
v4.0.0-rc1
v3.2.0
v3.1.0
v3.0.0
v2.1.0
v2.0.0
roma-v1
v2
Labels
Clear labels
WIP
bug
consensus-breaking
dependencies
documentation
duplicate
effort: high
effort: low
effort: medium
effort: trivial
enhancement
good first issue
help wanted
invalid
maintenance
question
task/feature
todo-in-rewrite
wontfix
bug
duplicate
enhancement
help wanted
invalid
pig lipstick
question
wontfix
Something is not working
This issue or pull request already exists
New feature
Need some help
Something is wrong
Muggle-facing enhancements
More information is needed
This won't be fixed
No labels
bug
Milestone
No items
No Milestone
Projects
Clear projects
No projects
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: QPQ-AG/sophia#476
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Created by: brainiacfive
I get a compiler warning
I am not using __x in my source. Tried to eliminate the String include from it, only Option left, but it throws the same warning; so it would not be include conflict. No other includes.
Looks like a compiler issue to me. Will provided a minimal source example later. Maybe you have an idea already from this stub notice.
Created by: brainiacfive
is verbatim the warning, not a placeholder I inserted.
Created by: marc0olo
@brainiacfive this is happening in a (currently) private contract, right?
if you can't provide a minimal example right now you could maybe invite @ghallak and/or @radrow to the repo to check with the contract where the compiler currently produces this warning
Created by: hanssv
I think the compiler uses the variable
__xwhen it desugars some of the Map-syntax - could be something 'interesting' going on there.Created by: hanssv
is a small example capturing the same problem - the compiled code is correct in this case, but that might be luck (cc @radrow and @ghallak )
Created by: brainiacfive
Much appreciated. I saw more warnings using
__xmeanwhile; in folds.Do you know which variable in your example is the first use of
__xthat would get shadowed by which other variable that is the second use? I'd be checking for patterns of that in the contract source to make sure it is harmless.Created by: radrow
It's a bug caused by running code analysis on desugared code. Nothing to worry about. We'll take a look and fix it soon.
Created by: radrow
If you are worried though, or if it may impact something serious, you can use
aesophia_cliwithpp_asmto check if the function is compiled correctly. The assembler should be fairly readable.Created by: brainiacfive
Thank you, will do!
Created by: brainiacfive
The asm code is fascinating but not something to crack on the fly. Can you @radrow @hanssv share what sugar is causing the use of
__xso I can change the code to avoid it? I assume a nesting of scopes is a prerequisite for the effect to happen. So I should be able to eliminate the select places this could be happening. I'd rather have this evened out, thanks!Created by: brainiacfive
Tried with replacing
with
On @hanssv recommendation, but so far no luck.
Created by: hanssv
You need to change all five of them, and indeed it does workaround the problem.
Created by: hanssv
I think the concrete issue has been worked around - as for the compiler, I think using
__xeverywhere might be a bit too simplistic 🙈 - and it should be fixed eventually.