Skip to content

Instance methods should be rejected if used as static methods #2952

@anton-trunov

Description

@anton-trunov

The following fails at the FunC stage, but should be rejected by the typechecker

message Hello {
    name: String
}

contract Test {
    receive() {
        message(MessageParameters{
            to: sender(),
            value: 0,
            mode: SendRemainingValue,
            body: Hello.toCell(), // `toCell` is mistakenly used as a static method here
        });
    }
}

Uncovered by @Gosunov

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind: bugSomething isn't working or isn't rightscope: typecheckerImplementation of typechecker (src/types)

    Type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions