aeternity / aesophia

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

Contract polymorphism crashes on non-obvious child contract typing #404

Closed radrow closed 2 years ago

radrow commented 2 years ago

Repro:

contract interface I =
  entrypoint f : () => int

contract C1 : I =
  entrypoint f() = 123

contract C2 : I =
  entrypoint f() = 888

namespace Make =
  stateful function new1() : I = Chain.create() : C1
  stateful function new2() : I = Chain.create() : C2

  stateful function new(c : I) : int =
    c.f()

This is caused by fcode compiler looking for bytecode of I for some reason (which doesn't make any sense since 1) it is not needed 2) it doesn't even exist).