view run/n/nested_class_03_A.d @ 1576:b3e16c86558e

[Issue 1398] New: GDC doesn't generate correct code <mariusmuja@gmail.com> 2007-08-04 http://d.puremagic.com/issues/show_bug.cgi?id=1398
author thomask
date Thu, 21 Feb 2008 15:20:08 +0000
parents b17e092dd992
children
line wrap: on
line source

// $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;
}