Mercurial > projects > dstress
changeset 1197:0e1bf1565db1
[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:35 +0000 |
parents | 20c590faad54 |
children | f272d893dd3e |
files | run/f/final_12_A.d run/f/final_12_B.d |
diffstat | 2 files changed, 66 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /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 <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 { + 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; +}
--- /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 <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_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; +}