[Swift-commit] r5851 - trunk/src/org/griphyn/vdl/engine

hategan at ci.uchicago.edu hategan at ci.uchicago.edu
Tue Jul 17 14:01:39 CDT 2012


Author: hategan
Date: 2012-07-17 14:01:38 -0500 (Tue, 17 Jul 2012)
New Revision: 5851

Modified:
   trunk/src/org/griphyn/vdl/engine/Karajan.java
Log:
better error message when types of from and to range parameters are of different type

Modified: trunk/src/org/griphyn/vdl/engine/Karajan.java
===================================================================
--- trunk/src/org/griphyn/vdl/engine/Karajan.java	2012-07-17 18:48:58 UTC (rev 5850)
+++ trunk/src/org/griphyn/vdl/engine/Karajan.java	2012-07-17 19:01:38 UTC (rev 5851)
@@ -1437,6 +1437,9 @@
 
 			String fromType = datatype(fromST);
 			String toType = datatype(toST);
+			if (!fromType.equals(toType)) {
+			    throw new CompilationException("To and from range values must have the same type");
+            }
 			if (stepST == null && (!fromType.equals("int") || !toType.equals("int"))) {
 				throw new CompilationException("Step in range specification can be omitted only when from and to types are int");
 			}




More information about the Swift-commit mailing list