15 lines
281 B
Mojo
15 lines
281 B
Mojo
# probe: 1.0.0 notes said __del__ still works, deprecated; does it in 1.1.0?
|
|
struct Old:
|
|
var v: Int
|
|
|
|
def __init__(out self, v: Int):
|
|
self.v = v
|
|
|
|
def __del__(deinit self):
|
|
print("old-style destructor ran")
|
|
|
|
|
|
def main():
|
|
var o = Old(1)
|
|
print(o.v)
|