Class: Rigor::Cache::RbsClassTypeParamNames

Inherits:
RbsCacheProducer show all
Defined in:
lib/rigor/cache/rbs_class_type_param_names.rb

Overview

Cache producer that materialises every loaded class's RBS-declared type-parameter names as a Marshal-clean Hash<String, Array<Symbol>> keyed by top-level-stripped class name (e.g. "Array"[:Elem], "Hash"[:K, :V]). Producer id "rbs.class_type_param_names".

The dispatcher reads type-parameter names every time it builds a substitution map from a receiver's type_args into a method's return type — it is one of the hottest reflection lookups during analysis. Building one entry requires a full RBS::DefinitionBuilder#build_instance over that class, the same expensive operation RbsClassAncestorTable caches; the two producers share the build cost when populated together.

Cache descriptor shape is shared with every other cache producer that depends on the RBS environment — see Rigor::Cache::RbsDescriptor.build.

Constant Summary collapse

PRODUCER_ID =
"rbs.class_type_param_names"

Method Summary

Methods inherited from RbsCacheProducer

fetch