mirror of
https://github.com/github/semantic.git
synced 2024-12-21 05:41:54 +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.
7 lines
139 B
Python
7 lines
139 B
Python
# CHECK-TREE: { foo <- rec foo = \a -> if a then a else #unit; #record { foo: foo } }
|
|
|
|
def foo(a):
|
|
if a: return a
|
|
return ()
|
|
()
|