Open
Description
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)