currently mut refernce will *not* be downgraded to shared if it is sufficient(see relevant test for example)
there are a few currently limitations: * no modifications of function body * does not handle mutability and references * no method support * may produce incorrect results