Checks that the Phase Consistency Principle (PCP) holds and heals types.
Type healing consists in transforming a phase inconsistent type
T into a splice of
tree refers to a locally defined symbol (either directly, or in a pickled type),
check that its staging level matches the current level. References to types
that are phase-incorrect can still be healed as follows:
T is a reference to a type at the wrong level, try to heal it by replacing it with
Check reference to
sym for phase consistency, where
tp is the underlying type
by which we refer to
sym. If it is an inconsistent type try construct a healed type for it.
Check and heal all named types and this-types in a given type for phase consistency.
Does the level of
sym match the current level?
An exception is made for inline vals in macros. These are also OK if their level
is one higher than the current level, because on execution such values
are constant expression trees and we can pull out the constant from the tree.
Transform quoted trees while maintaining phase correctness
Transform splice - If inside a quote, transform the contents of the splice. - If inside inlined code, expand the macro code. - If inside of a macro definition, check the validity of the macro.