vx-lang / vx-lang/Vx

Seam assert pre-scan misses assertions nested inside expressions

Closed
#620 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
14
Forks
2
Avg merge
13h 13m
Merged PRs (30d)
70

Description

The seam-contract pre-scan collects assert(var == const) only from selected block-bearing expressions such as spawn, if, and loops. It skipped assertions inside ordinary expression containers.

Example:

fn f(value: i32) -> i32 {
    let result = 1 + if 1 == 1 {
        assert(value == 42);
        2
    } else {
        3
    };
    return result;
}

The assertion is valid Vx and should contribute the contract value == 42.

Related: https://github.com/vx-lang/Vx/issues/491

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the seam-contract pre-scan logic that handles block-bearing expressions such as spawn, if, and loops, then reproduce the supplied function with an assertion nested in an expression container. Done means the nested assert(value == 42) contributes the seam contract just like assertions in the currently handled expressions.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.