Fix var type inference2

Giving it another try.
rule myFunction(X => .)
When moving the rewrite at the top, then the type decreasing property still holds.