mirror of
https://github.com/github/codeql.git
synced 2026-07-29 06:46:46 +02:00
10 lines
317 B
Python
10 lines
317 B
Python
# Walrus edge cases — wired in the new CFG.
|
|
|
|
# Walrus in expression context.
|
|
if (y := 5) > 0: # $ cfgdefines=y
|
|
pass
|
|
|
|
# Walrus in a comprehension. The comprehension introduces a synthetic
|
|
# `.0` parameter bound to the iterable.
|
|
_ = [w for _ in range(3) if (w := 1)] # $ cfgdefines=_ cfgdefines=w cfgdefines=.0
|