diff options
-rw-r--r-- | src/monoize.sml | 10 | ||||
-rw-r--r-- | tests/polyjs.ur | 5 | ||||
-rw-r--r-- | tests/polyjs.urp | 5 | ||||
-rw-r--r-- | tests/polyjsFfi.urs | 2 |
4 files changed, 21 insertions, 1 deletions
diff --git a/src/monoize.sml b/src/monoize.sml index b1cef64b..39e4853b 100644 --- a/src/monoize.sml +++ b/src/monoize.sml @@ -4087,7 +4087,15 @@ fun monoExp (env, st, fm) (all as (e, loc)) = in ((L'.EAbs (x, monoType env dom, monoType env ran, e), loc), fm) end - | L.ECApp _ => poly () + + | L.ECApp (e, _) => + let + val (e, fm) = monoExp (env, st, fm) e + in + case #1 e of + L'.EFfi _ => (e, fm) + | _ => poly () + end | L.ECAbs _ => poly () | L.EFfi mx => ((L'.EFfi mx, loc), fm) diff --git a/tests/polyjs.ur b/tests/polyjs.ur new file mode 100644 index 00000000..fe10080b --- /dev/null +++ b/tests/polyjs.ur @@ -0,0 +1,5 @@ +open PolyjsFfi + +fun main () : transaction page = return <xml><body> + <button onclick={fn _ => alert (one "hi" ^ two "bye")}/> +</body></xml> diff --git a/tests/polyjs.urp b/tests/polyjs.urp new file mode 100644 index 00000000..489bd68b --- /dev/null +++ b/tests/polyjs.urp @@ -0,0 +1,5 @@ +ffi polyjsFfi +jsFunc PolyjsFfi.one=one +jsFunc PolyjsFfi.two=two + +polyjs diff --git a/tests/polyjsFfi.urs b/tests/polyjsFfi.urs new file mode 100644 index 00000000..a2be8909 --- /dev/null +++ b/tests/polyjsFfi.urs @@ -0,0 +1,2 @@ +val one : a ::: Type -> a -> a +val two : a ::: Type -> b ::: Type -> a -> b |