Typechecker crashes if Chain.create or Chain.clone are used without arguments #393

Closed
opened 2022-06-20 01:07:25 +09:00 by zxq9 · 2 comments
zxq9 commented 2022-06-20 01:07:25 +09:00 (Migrated from gitlab.com)

Created by: radrow

Repro:

contract C =
  entrypoint f() =
    let x = Chain.create
    123

Error is thrown by occurs_check1 where var_args are not handled. This is invalid and references to both functions without application should be banned in infer_expr.

*Created by: radrow* Repro: ``` contract C = entrypoint f() = let x = Chain.create 123 ``` Error is thrown by `occurs_check1` where `var_args` are not handled. This is invalid and references to both functions without application should be banned in `infer_expr`.
ghallak commented 2022-10-30 01:11:30 +09:00 (Migrated from gitlab.com)

Edit: Never mind what is written below, occurs_check on var_args cannot return neither true nor false.

@radrow Why ban the references to these functions without application, instead of treating them like other normal functions.

The following code is valid for example:

namespace Nsp =
    function f(x) = x + 1

contract C =
  entrypoint f() =
    let x = Nsp.f
    x(1) + 1
**Edit: Never mind what is written below, occurs_check on var_args cannot return neither true nor false.** @radrow ~Why ban the references to these functions without application, instead of treating them like other normal functions.~ The following code is valid for example: ``` namespace Nsp = function f(x) = x + 1 contract C = entrypoint f() = let x = Nsp.f x(1) + 1 ```
zxq9 commented 2022-10-30 02:05:16 +09:00 (Migrated from gitlab.com)

Created by: radrow

Inference of var args is unobvious and hardly useful

*Created by: radrow* Inference of var args is unobvious and hardly useful
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#393
No description provided.