changeset 583:b17e092dd992

anonymous class John C <johnch_atms@hotmail.com> 2005-06-09 news:d88vta$vak$1@digitaldaemon.com
author thomask
date Sat, 18 Jun 2005 07:15:32 +0000
parents 3590dd6f8f0d
children 132fb528f935
files run/n/nested_class_03_A.d
diffstat 1 files changed, 38 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /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 <johnch_atms@hotmail.com>
+// @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;
+}