view nocompile/invariant_16.d @ 66:33346dff2640

extended invariant tests
author thomask
date Sat, 23 Oct 2004 10:09:46 +0000
parents
children f87ba6507260
line wrap: on
line source

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

module dstress.nocompile.invariant_16;

interface MyInterface{
	private int check();
	invariant{
		assert(check()!=4);
	}
}
class MyClass : MyInterface {
	void test(){
	}

	private int check(){
		return 4;
	}
}

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