Use 'CachedValue' and dependency handling with 'ModificationTracker' for dependent session invalidation.
PsiElement.getExpectedType()