Skip to content

ContractImp Constraint Violations when Importing #4

@noschiff

Description

@noschiff

Should ContractImp have constraint violations? This is pretty unhelpful to the user.

import "B.scif";

contract A {
    B addr;
    constructor() { super(); }

    @public void foo() {
        addr.bar();
    }
}
contract B {
    constructor() { super(); }

    @public void bar () {
    }
}

gives

/Users/noah/Cornell/SCIF/compiler/./.scif/foo0.ifc | <----
Static type error.
Code locations most likely to be wrong:
1. ContractImp.scif, line 16, column 22: 
Argument from may be labeled incorrectly.
    bool bypassLocks(address from) {
                     ^

If we turn B into

contract B {
    constructor() { super(); }

    @public void bar () {
        uint x = 0;
    }
}

we get

/Users/noah/Cornell/SCIF/compiler/./.scif/foo0.ifc | <----
Static type error.
Code locations most likely to be wrong:

  1. ContractImp.scif, line 37, column 22:
    Argument l may be labeled incorrectly.
    bool releaseLock(address l) {
    ^

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions