Resolve field constraints by the types of the fields #381

Open
opened 2022-05-03 22:49:30 +09:00 by ghallak · 0 comments
ghallak commented 2022-05-03 22:49:30 +09:00 (Migrated from gitlab.com)

Both of the following examples give ambiguity error, but if it would be possible to check the types of the fields during field constraints resolving, the error would not happen.

Example 1:

contract C =
    record r1 = { r : int }
    record r2 = { r : string }

    entrypoint f() = { r = "s" }

Example 2:

include "String.aes"

contract First =
    entrypoint print_num(x) = 1 + x

contract Second =
    entrypoint print_num(x) = String.to_lower(x)

main contract Test =
    entrypoint f(c) = c.print_num(1)
Both of the following examples give ambiguity error, but if it would be possible to check the types of the fields during field constraints resolving, the error would not happen. Example 1: ``` contract C = record r1 = { r : int } record r2 = { r : string } entrypoint f() = { r = "s" } ``` Example 2: ``` include "String.aes" contract First = entrypoint print_num(x) = 1 + x contract Second = entrypoint print_num(x) = String.to_lower(x) main contract Test = entrypoint f(c) = c.print_num(1) ```
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#381
No description provided.