CrossStageSafety
Checks that staging level consistency holds and heals staged types .
Local term references are level consistent if and only if they are used at the same level as their definition.
Local type references can be used at the level of their definition or lower. If used used at a higher level, it will be healed if possible, otherwise it is inconsistent.
Type healing consists in transforming a level inconsistent type T
into summon[Type[T]].Underlying
.
As references to types do not necessarily have an associated tree it is not always possible to replace the types directly. Instead we always generate a type alias for it and place it at the start of the surrounding quote. This also avoids duplication. For example: '{ val x: List[T] = ListT () }
is transformed to
'{ type t$1 = summon[Type[T]].Underlying val x: List[t$1] = Listt$1; () }
Attributes
- Graph
-
- Supertypes
-
class TreeMapWithStagesclass TreeMapWithImplicitsclass TreeMapclass Objecttrait Matchableclass Any