Skip to content

Require more precise type resolution in binary operation #257

Open
@katat

Description

@katat

In type checking phase, the type of a binary operation expression is only determined by the left hand side:

Op2::Addition

However, in the following case, it can mistakenly seen a non constant expression as constant;

fn is_not_constant(val: Field) -> Field {
    // val can be non constant
    return 1 + val;
}

1 + val can be a non constant field type as val can be a non constant.
Therefore, when computing the types for the binary operations, it should take cares of the both sides.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions