fix bug in inferring block statements when type inference fails