Skip to content

User-defined function calls are rejected in expression position #65

@michaelsutton

Description

@michaelsutton

Internal function calls currently work in assignment form, but fail when used directly inside an expression.

This compiles:

contract Calls() {
    function one() : (int) {
        return(1);
    }

    entrypoint function main() {
        (int value) = one();
        require(value == 1);
    }
}

but this fails:

contract Calls() {
    function one() : (int) {
        return(1);
    }

    entrypoint function main() {
        require(one() == 1);
    }
}

with:

unknown function call: one

This looks like statement-level calls are handled by inline expansion, while expression-position calls go through the builtin-only function-call path and never resolve user-defined functions.

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