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

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

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

T t1(1);
t1.set(t1);
#printf("before clear\n");
#t1.set();
#printf("clear\n");
