Like ExprHasRefId or IdOf, ContextOf propagates context information up from leaves in the current context, so we know the context of an expression. We do not need a ListExpr version of ContextOf, as the only ListExpr child in the schema is of Switch; Switch takes its context from its predicate rather than its branches.
This PR contains some commented-out code that checks that one expression doesn't get two nonequivalent contexts, since it is not certain whether that's a problem.
Like ExprHasRefId or IdOf, ContextOf propagates context information up from leaves in the current context, so we know the context of an expression. We do not need a ListExpr version of ContextOf, as the only ListExpr child in the schema is of Switch; Switch takes its context from its predicate rather than its branches.
This PR contains some commented-out code that checks that one expression doesn't get two nonequivalent contexts, since it is not certain whether that's a problem.