Baseline: tree as shared
This commit is contained in:
commit
659c03bbf8
1471 files changed
+990535
No files matched your search
@@ -0,0 +1,31 @@
|
||||
# probe: used in both branches: does it die right after its last use in each?
|
||||
struct L(Copyable, Movable):
|
||||
var n: String
|
||||
|
||||
def __init__(out self, n: String):
|
||||
self.n = n
|
||||
print("init", n)
|
||||
|
||||
def __init__(out self, *, deinit move: Self):
|
||||
self.n = move.n^
|
||||
print("move", self.n)
|
||||
|
||||
def __deinit__(deinit self):
|
||||
print("bye", self.n)
|
||||
|
||||
|
||||
def run(flag: Bool):
|
||||
var a = L("a")
|
||||
if flag:
|
||||
print("then uses", a.n)
|
||||
print("then after use")
|
||||
else:
|
||||
print("else uses", a.n)
|
||||
print("else after use")
|
||||
print("after if")
|
||||
|
||||
|
||||
def main():
|
||||
run(True)
|
||||
print("---")
|
||||
run(False)
|
||||
Reference in new issue
Block a user