Polymorphism is broken on init #413

Closed
opened 2022-09-03 15:56:53 +09:00 by zxq9 · 0 comments
zxq9 commented 2022-09-03 15:56:53 +09:00 (Migrated from gitlab.com)

Created by: radrow

Repro:

payable contract interface SalesOffer =
    entrypoint init : (address, address, int, int) => void
    payable entrypoint do_a_backflip : () => bool

payable contract Test : SalesOffer =
  entrypoint init(_, _, _, _) = ()
  payable entrypoint do_a_backflip() = true

Error:

Unimplemented function `init` from the interface `SalesOffer` in the contract `Test`

Note that this should compile no matter of the return type of the init function (void is technically a subtype of everything).

*Created by: radrow* Repro: ``` payable contract interface SalesOffer = entrypoint init : (address, address, int, int) => void payable entrypoint do_a_backflip : () => bool payable contract Test : SalesOffer = entrypoint init(_, _, _, _) = () payable entrypoint do_a_backflip() = true ``` Error: ``` Unimplemented function `init` from the interface `SalesOffer` in the contract `Test` ``` Note that this should compile no matter of the return type of the init function (void is technically a subtype of everything).
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#413
No description provided.