coreblocks icon indicating copy to clipboard operation
coreblocks copied to clipboard

Exclusive branches in diamond call graphs

Open tilk opened this issue 1 year ago • 1 comments

Suppose we have a code like this:

@def_method(m, method1):
def _():
    method3(m)

@def_method(m, method2):
def _():
    method3(m)

with Transaction().body(m):
    with m.If(foo):
        method1(m)
    with m.Else():
        method2(m)

Currently, an exception "Method 'method3' can't be called twice from the same transaction" will be raised. But these calls are on syntactically different branches, so they could technically be allowed.

tilk avatar Jan 15 '24 13:01 tilk