Skip to content

Usages of unbound local variables not always caught in @Pure functions #252

@marcoeilers

Description

@marcoeilers

The following program verifies but should not, since variable a is read but not always defined.

from nagini_contracts.contracts import *

@Pure
def oops(i: int) -> int:
    if i > 0:
        a = 5
    b = a
    return 5

oops(-2)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions