aeternity / aesophia

Stand alone compiler for the Sophia smart contract language
https://docs.aeternity.com/aesophia
ISC License
51 stars 19 forks source link

allow datatype usage from other contracts, not just namespaces #472

Closed thepiwo closed 1 year ago

thepiwo commented 1 year ago
contract C2 =
  datatype dt = Zero | One(int)

main contract C =
  entrypoint foo(d : Cx.dt) =
    switch (d)
      Cx.Zero => 0
      Cx.One(_) => 1

doesn't work as expected, whereas

 namespace Cx =
  datatype dt = Zero | One(int)

contract interface C2 =
  entrypoint x: (Cx.dt) => int

contract C =
  entrypoint foo(d : Cx.dt) =
    switch (d)
      Cx.Zero => 0
      Cx.One(_) => 1

does

thepiwo commented 1 year ago

closing as duplicate of https://github.com/aeternity/aesophia/issues/471