Fix json()
when inferring the return type
#3797
Merged
json()
when inferring the return type
#3797