ScratchVar load before store conflicting with Subroutines.
- Vorherrschende Sprache
- Python
- Sterne
- 288
- Forks
- 138
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
### Subject of the issue
Compiler checks for load before store do not work as expected when Subroutines that takes ScratchVar as arguments are used.
### Steps to reproduce
```python
from pyteal import *
def example():
var = ScratchVar(TealType.uint64)
@Subroutine(TealType.none)
def sub(x: ScratchVar):
return x.store(Int(0))
return Seq([
sub(var),
Pop(var.load()),
Approve()
])
if __name__ == '__main__':
print(compileTeal(example(), mode=Mode.Application, version=6))
```
### Expected behaviour
Contract can compile correctly
### Actual behaviour
`pyteal.TealCompileError: Scratch slot load occurs before store`
Beitragsleitfaden
Bewertung
Dieses Issue wurde noch nicht bewertet.