view run/f/final_12_A.d @ 1198:f272d893dd3e

[Issue 440] New: dmd.170 fails to mark final methods as implementations of abstract ones Tomasz Stachowiak <h3r3tic@mat.uni.torun.pl> 2006-10-17 news:bug-440-3@http.d.puremagic.com/issues/
author thomask
date Sat, 21 Oct 2006 13:27:44 +0000
parents 0e1bf1565db1
children daef239f37cf
line wrap: on
line source

// $HeadURL$
// $Date$
// $Author$

// @author@	Tomasz Stachowiak <h3r3tic@mat.uni.torun.pl>
// @date@	2006-10-17
// @uri@	news:bug-440-3@http.d.puremagic.com/issues/
// @desc@	[Issue 440] New: dmd.170 fails to mark final methods as implementations of abstract ones

module dstress.run.f.final_12_A;

int status;

interface I {
	int foo();
}

class C : I {
	final int foo() {
		return ++status;
	}
}

int main() {
	C c = new C();
	if(c.foo() != 1){
		assert(0);
	}
	I i = c;
	if(i.foo() != 2){
		assert(0);
	}

	return 0;
}