view run/odd_bug_02.d @ 1330:f3f715978184

Georg Wrede <georg@iki.fi> 2007-01-07 mail:45A120F5.1050108@iki.fi
author thomask
date Sat, 13 Jan 2007 10:33:49 +0000
parents a33ad7189d21
children 52c9e86b6486
line wrap: on
line source

// $HeadURL$
// $Date$
// $Author$

// @author@	Ben Hinkle <bhinkle4@juno.com>
// @date@	2004-09-26
// @uri@	news:cj6g4d$9iv$1@digitaldaemon.com
// @url@	nntp://digitalmars.com/digitalmars.D.bugs/1953

module dstress.run.odd_bug_02;

// @WARNING@: this code requires phobos
import std.stdarg;

struct TestStruct{
	void add(...){
		TestStruct other = va_arg!(TestStruct)(_argptr);
		foreach(int value; other){
			foo();
		}
	}

	void foo(){
		assert(left is null);
		bar();
	}

	void bar(){
		assert(left is null);
	}

	int opApply(int delegate(inout int val) dg){
		return 0;
	}

	void* left;
}

int main(){
	TestStruct t;
	t.foo();
	return 0;
}