#!/usr/bin/env qore
# -*- mode: qore; indent-tabs-mode: nil -*-

%require-our
%requires qore >= 0.8
%new-style

class T1 { 
    public { int id; *T1 a; *T1 b; } 
    constructor(int i) { id = i; } 
    destructor() { printf("deleting %d\n", id); } 
    set(*T1 aa) { a = aa; }
}

#  t2.a -> t1, t1.a -> t2, t2.b -> t1  ---> [ t1(2), t2(1) ]
T1 t1(1);
t1.set(t1);
t1.b = t1;
