mirror of
https://github.com/github/semantic.git
synced 2024-12-24 23:42:31 +03:00
01b4a23b23
Code like the following kind is legal in Python: ```python def recursive(a): return recursive ``` This implies that function and class definitions need to use the Core `rec` construct so that their bodies have an appropriate entry in the scope.
8 lines
249 B
Python
8 lines
249 B
Python
# CHECK-TREE: { passthru <- rec passthru = \x -> x; decorated <- rec decorated = \x -> x; decorated = passthru(decorated); #record { passthru: passthru, decorated: decorated }}
|
|
def passthru(x):
|
|
return x
|
|
|
|
@passthru
|
|
def decorated(x):
|
|
return x
|