[Python] Nested set comprehension results in invalid generated code #5285
Labels
during 4: bad execution of correct program
A bug in the Dafny compiler that causes a correct Dafny program to execute incorrectly
kind: bug
Crashes, unsoundness, incorrect output, etc. If possible, add a `part:` label
lang: python
Dafny's Python transpiler and its runtime
Dafny version
4.6.0
Code to produce this issue
Command to run and resulting output
What happened?
I expected to see some valid output (ex a
Set(["a"])
); instead I ran into a NameError.The
d_0_someString_
variable is not defined in the scope of a child method, so it cannot be accessed.The Python code generation generation may need to define this variable at a higher scope, or may need to pass this variable to the child method
iife2
.(This is a lightweight example reproducing a similar error I encountered in some AWS Cryptography MPL code: link)
(My grasp of set comprehension syntax is poor, so there is probably a more minimal example.)
What type of operating system are you experiencing the problem on?
Mac
The text was updated successfully, but these errors were encountered: