scaml.ppx: 2 smart contract modules in same file only work with the same storage type
Just modifying ppx/tests/test_ppx.ml
(adding at line 15).
If I add
module Smart_contract_2 = struct
[@@@SCaml]
let[@entry] default () _ = ([], Foo (Int 42))
end
it seems to typecheck and run (but I don't think the contract is added to SCamlc.Ppx.rev_modules
)
but with
module Smart_contract_2 = struct
[@@@SCaml]
let[@entry] default () _ = ([], (* Foo *) (Int 42))
end
I get an error pointing at the other module:
File "ppx/tests/test_ppx.ml", line 11, characters 15-22:
11 | let [@entry] default () _ =
^^^^^^^
Error: [ESCaml310] Entry point typing error
File "ppx/tests/test_ppx.ml", line 11, characters 15-22:
11 | let [@entry] default () _ =
^^^^^^^
This pattern matches values of type unit -> SCaml.int -> SCaml.operations *
t
but a pattern was expected which matches values of type
(unit, SCaml.int) SCaml.entry =
unit -> SCaml.int -> SCaml.operations * SCaml.int
Type t is not compatible with type SCaml.int