diff run/return_06.d @ 322:0c38b6a3aab2

paths without return statements are specifically allowed, the compiler has to insert an assert(0) Walter <walter@digitalmars.com> 2005-03-17 mail:000d01c52b1d$0cd44110$0200a8c0@colossus
author thomask
date Thu, 17 Mar 2005 21:37:29 +0000
parents
children 9a121126b077
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/run/return_06.d	Thu Mar 17 21:37:29 2005 +0000
@@ -0,0 +1,23 @@
+// $HeadURL$
+// $Date$
+// $Author$
+
+// path without return 
+
+module dstress.run.return_06;
+
+int test(int i){
+	if(i==0){
+		return 2;
+	}
+}
+
+int main(){
+	assert(test(0)==2);
+	try{
+		test(1);
+	}catch{
+		return 0;
+	}
+	assert(0);
+}