diff dmd/TypeReturn.d @ 130:60bb0fe4563e

dmdfe 2.037 first main iteration
author Eldar Insafutdinov <e.insafutdinov@gmail.com>
date Thu, 09 Sep 2010 22:51:44 +0100
parents e28b18c23469
children e3afd1303184
line wrap: on
line diff
--- a/dmd/TypeReturn.d	Sun Sep 05 15:32:22 2010 +0400
+++ b/dmd/TypeReturn.d	Thu Sep 09 22:51:44 2010 +0100
@@ -53,6 +53,11 @@
 			goto Lerr;
 		}
 		t = sc.func.type.nextOf();
+        if (!t)
+        {
+	        error(loc, "cannot use typeof(return) inside function %s with inferred return type", sc.func.toChars());
+	        goto Lerr;
+        }
 		t = t.addMod(mod);
 
 		if (idents.dim)