view nocompile/invariant_09.d @ 59:96cadd0da1ae

added invariant tests
author thomask
date Fri, 22 Oct 2004 20:29:58 +0000
parents
children f87ba6507260
line wrap: on
line source

// invariant is only allowed in classes (dmd-0.104 documentation)

module dstress.nocompile.invariant_09;

class MyClass{
	int test(){
		invariant{
			assert(0);
		}
		return 0;
	}
}

int main(){
	Myclass c = new MyClass();
	return c.test();
}