Fix InferType
and improve type-checker tests
#3382
Merged
InferType
and improve type-checker tests
#3382