# HG changeset patch # User thomask # Date 1119078932 0 # Node ID b17e092dd99254cf00909aea2bc0879b257faa0f # Parent 3590dd6f8f0dbdfcb921f9224ef7f86a8021aa38 anonymous class John C 2005-06-09 news:d88vta$vak$1@digitaldaemon.com diff -r 3590dd6f8f0d -r b17e092dd992 run/n/nested_class_03_A.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/n/nested_class_03_A.d Sat Jun 18 07:15:32 2005 +0000 @@ -0,0 +1,38 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ John C +// @date@ 2005-06-09 +// @uri@ news:d88vta$vak$1@digitaldaemon.com + +module dstress.run.n.nested_class_03_A; + +interface Inner{ + int value(); +} + +class Outer{ + int x; + + Inner test(){ + return new class Inner { + int y; + + this(){ + y=x; + } + + int value(){ + return y; + } + }; + } +} + +int main(){ + Outer o = new Outer(); + o.x=2; + assert(o.test().value() == o.x); + return 0; +}