diff options
-rw-r--r-- | src/elaborate.sml | 12 | ||||
-rw-r--r-- | tests/empty.ur | 0 | ||||
-rw-r--r-- | tests/ffisub.urp | 3 | ||||
-rw-r--r-- | tests/ffisub.urs | 5 |
4 files changed, 20 insertions, 0 deletions
diff --git a/src/elaborate.sml b/src/elaborate.sml index 5b18ae94..ca4e124c 100644 --- a/src/elaborate.sml +++ b/src/elaborate.sml @@ -4123,6 +4123,18 @@ and elabDecl (dAll as (d, loc), (env, denv, gs)) = val dNew = (L'.DFfiStr (x, n, sgn'), loc) in + case #1 sgn' of + L'.SgnConst sgis => + (case List.find (fn (L'.SgiConAbs _, _) => false + | (L'.SgiCon _, _) => false + | (L'.SgiDatatype _, _) => false + | (L'.SgiVal _, _) => false + | _ => true) sgis of + NONE => () + | SOME sgi => (ErrorMsg.errorAt loc "Disallowed signature item for FFI module"; + epreface ("item", p_sgn_item env sgi))) + | _ => raise Fail "FFI signature isn't SgnConst"; + Option.map (fn tm => ModDb.insert (dNew, tm)) tmo; ([dNew], (env', denv, enD gs' @ gs)) end) diff --git a/tests/empty.ur b/tests/empty.ur new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/tests/empty.ur diff --git a/tests/ffisub.urp b/tests/ffisub.urp new file mode 100644 index 00000000..b695bad1 --- /dev/null +++ b/tests/ffisub.urp @@ -0,0 +1,3 @@ +ffi ffisub + +empty diff --git a/tests/ffisub.urs b/tests/ffisub.urs new file mode 100644 index 00000000..ce245884 --- /dev/null +++ b/tests/ffisub.urs @@ -0,0 +1,5 @@ +structure S : sig + type t +end + +val x : S.t |