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

Closed
opened 2022-08-02 23:43:36 +09:00 by zxq9 · 0 comments
zxq9 commented 2022-08-02 23:43:36 +09:00 (Migrated from gitlab.com)

Created by: radrow

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).

*Created by: radrow* 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).
Sign in to join this conversation.
No Milestone
No project
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: QPQ-AG/sophia#404
No description provided.