changeset 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 c1396281e0e8
children c8c5c7a82c94
files nocompile/return_06.d nocompile/return_07.d run/return_06.d
diffstat 3 files changed, 23 insertions(+), 29 deletions(-) [+]
line wrap: on
line diff
--- a/nocompile/return_06.d	Thu Mar 17 21:29:28 2005 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,13 +0,0 @@
-// $HeadURL$
-// $Date$
-// $Author$
-
-// path without return 
-
-module dstress.nocompile.return_06;
-
-int main(char[][] args){
-	if(args.length==0){
-		return 0;
-	}
-}
--- a/nocompile/return_07.d	Thu Mar 17 21:29:28 2005 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,16 +0,0 @@
-// $HeadURL$
-// $Date$
-// $Author$
-
-// path without return 
-
-module dstress.nocompile.return_07;
-
-int main(char[][] args){
-	if(args.length==0){
-		return 0;
-	}else{
-		// dummy
-		args.length==2;
-	}
-}
--- /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);
+}