#!/usr/local/bin/rune -x # # Test self-referencing argument defaults import "sys"; import ; struct Fubar { int a; } int main(int ac, string_p *av) { Fubar q; q.a = 44; q.testfunc(3); } # Test default assignments # # In compilations, also tests temporary storage used for argument # defaults (the 'this->a + 23' can be fairly nasty) # method void Fubar.testfunc(int expect, int x = 1, int y = x + 2, int z = this->a + 23) { stdio.stdout->format("y is (%d): %d\n", expect, y); stdio.stdout->format("z is (67): %d\n", z); }