Gradualizer icon indicating copy to clipboard operation
Gradualizer copied to clipboard

Unintelligible error: ... expected to have type state() but it has type state()

Open erszcz opened this issue 2 years ago • 2 comments

Another one from #373:

apps/aevm/src/aevm_eeevm_state.erl: The variable on line 504 at column 11 is expected to have type state() but it has type state()

    State1 = aevm_eeevm_memory:write_area(Offs, Mem, State),
    State2 = aevm_eeevm_maps:merge(Maps, State1),
    {Ptr, State2}.
          ^^^^^^

erszcz avatar Mar 23 '22 15:03 erszcz

I suspect there are state() types in two different modules. The error message doesn't show the module name even if there is some info in the filename anno.

zuiderkwast avatar Mar 25 '22 13:03 zuiderkwast

Yep, that's one option. Alternatively, it might be that somehow the state() type with the file annotation is compared with the same type without the annotation and is not equal which leads to the error being reported.

erszcz avatar Mar 25 '22 16:03 erszcz