class Savi::Compiler::SubtypingCache
- Savi::Compiler::SubtypingCache
- Reference
- Object
Overview
This is not really a compiler pass!
This is a cache layer that lets us cache some computations that depend on other compiler passes, but there is no point when this pass gets "run".
Instead it is merely leveraged by other passes incrementally and as needed at any point in time after the passes it depends on have been completed.
Because of this, we should ensure every operation exposed by this class is strictly a cache, and not treated like a repository of analysis that can ever be "completed", like the true compiler passes are.
This cache depends on the following passes, and thus can be used at any time after these passes have completed and made their analysis fully available:
- ctx.type_context
- ctx.pre_subtyping
- ctx.pre_infer
- ctx.infer
Defined in:
savi/compiler/subtyping_cache.crConstructors
Instance Method Summary
- #for_rf(rf : ReifiedFunction)
-
#for_rt(rt : ReifiedType)
TODO Make these private?
- #is_subtype_of?(ctx, sub_rt : ReifiedType, super_rt : ReifiedType) : Bool