8000 `deepEquals` fails on inline `emptyMap()` argument, but works when assigned to variable · Issue #2942 · tact-lang/tact · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
deepEquals fails on inline emptyMap() argument, but works when assigned to variable #2942
Open
@Gusarich

Description

@Gusarich

Reproduction (compiles successfully):

contract C() {
    receive() {}
    get fun f(): Bool {
        let fizz: map<Int, Int> = emptyMap();
        let buzz: map<Int, Int> = emptyMap();

        return fizz.deepEquals(buzz);
    }
}

Reproduction (fails to compile):

contract C() {
    receive() {}
    get fun f(): Bool {
        let fizz: map<Int, Int> = emptyMap();

        return fizz.deepEquals(emptyMap());
    }
}

Actual Error:

Error: test.tact:6:16: expects a map as self argument

Summary:
The error occurs only when emptyMap() is passed inline as the argument to deepEquals, yet the compiler incorrectly blames the receiver (fizz) with expects a map as self argument. This is misleading: fizz is unchanged between the working and failing versions. The actual difference lies in the second argument (buzz vs emptyMap()), but the error points to the wrong part of the expression, making debugging harder and hinting at an issue in type inference or method resolution involving inline map expressions.


LLM Fuzzing discovery (see #2490)

Metadata

Metadata

Assignees

No one assigned

    Labels

    activity: llm-fuzzingIssues found using LLM fuzzingfeature: mapsThe map datatype and operations on itscope: errorsError reporting mechanism (src/error)

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0