# HG changeset patch # User thomask # Date 1161437255 0 # Node ID 0e1bf1565db102be70dee77e417b753ac488cfab # Parent 20c590faad5402161f81361b6652e035b8a4bce4 [Issue 440] New: dmd.170 fails to mark final methods as implementations of abstract ones Tomasz Stachowiak 2006-10-17 news:bug-440-3@http.d.puremagic.com/issues/ diff -r 20c590faad54 -r 0e1bf1565db1 run/f/final_12_A.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/f/final_12_A.d Sat Oct 21 13:27:35 2006 +0000 @@ -0,0 +1,35 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Tomasz Stachowiak +// @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 { + void 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; +} diff -r 20c590faad54 -r 0e1bf1565db1 run/f/final_12_B.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/f/final_12_B.d Sat Oct 21 13:27:35 2006 +0000 @@ -0,0 +1,31 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Tomasz Stachowiak +// @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_B; + +int status; + +interface I { + void foo(); +} + +class C : I { + final int foo() { + return ++status; + } +} + +int main() { + I i = new C(); + if(i.foo() != 1){ + assert(0); + } + + return 0; +}