changeset 1401:af501150678a

Error message when FOREIGN KEY listts have different lengths
author Adam Chlipala <adam@chlipala.net>
date Sun, 16 Jan 2011 14:16:09 -0500
parents c57414e39321
children d6ea63612909
files src/urweb.grm
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/urweb.grm	Sun Jan 16 12:06:38 2011 -0500
+++ b/src/urweb.grm	Sun Jan 16 14:16:09 2011 -0500
@@ -589,6 +589,13 @@
                                                            end)
                                                        (EVar (["Basis"], "mat_nil", Infer), loc)
                                                        (#1 tnames :: #2 tnames, #1 tnames' :: #2 tnames')
+                                                 handle ListPair.UnequalLengths =>
+                                                        (ErrorMsg.errorAt loc ("Unequal foreign key list lengths ("
+                                                                               ^ Int.toString (1 + length (#2 tnames))
+                                                                               ^ " vs. "
+                                                                               ^ Int.toString (1 + length (#2 tnames'))
+                                                                               ^ ")");
+                                                         (EVar (["Basis"], "mat_nil", Infer), loc))
 
                                              fun findMode mode =
                                                  let