Resolve ambiguity based on the arity of an entrypoint #380

Closed
opened 2022-04-30 22:46:22 +09:00 by ghallak · 0 comments
ghallak commented 2022-04-30 22:46:22 +09:00 (Migrated from gitlab.com)
contract First =
  entrypoint print_num(x) = 1 + x

contract Second =
  entrypoint print_num() = 1

main contract Test =
  stateful entrypoint f(c) = c.print_num(1)

The above code fails with the type error:

Ambiguous record type with field `print_num` could be one of
  - `First` (at line 1, column 10)
  - `Second` (at line 4, column 10)

But it should be able to find the correct contract to use since First.print_num accepts a single argument, but Second.print_num does not accept any arguments.

``` contract First = entrypoint print_num(x) = 1 + x contract Second = entrypoint print_num() = 1 main contract Test = stateful entrypoint f(c) = c.print_num(1) ``` The above code fails with the type error: ``` Ambiguous record type with field `print_num` could be one of - `First` (at line 1, column 10) - `Second` (at line 4, column 10) ``` But it should be able to find the correct contract to use since `First.print_num` accepts a single argument, but `Second.print_num` does not accept any arguments.
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#380
No description provided.