Newer
Older
zweic / tests / 5 / parents3.zwei
@glproj03 glproj03 on 6 Feb 2006 604 bytes compiler working!
//#isut
//#430

class Question {
	Int i;
}

class Answer {
	Question q;
	Null print() {
		printInt(this.q.i);
	}
}

class Rubbish extends Answer{
	Null print() {
		printInt(! this.q.i);
	}	
}

class GeorgeBush {
	Answer answer(Question q) {
		return new Answer(q)
	}
}

class GeorgeWBush extends GeorgeBush {
	Rubbish answer(Question q) {
		return new Rubbish(q)
	}
}

{
	Question q = new Question(43);
	GeorgeBush me = new GeorgeBush();
	GeorgeWBush minime = new GeorgeWBush();

	Answer v = me.answer(q);
	Answer w = minime.answer(q);

	v.print();
	w.print();
}