pub fn cast_source_types(target_name: &str) -> impl Iterator<Item = TypeId>Expand description
Lists every source TypeId with a registered cast to target_name. Used by the type checker
(ty.rs) to validate a cast without needing to touch a [DynSegment] - reads the exact same
tables OpLookup::lookup_cast does, so the two can’t drift out of sync.
-
Postcondition: yields no items if
target_namenames no recognized cast-target type. -
Complexity: O(s) where s is the number of registered sources for
target_name.
§Examples
use cel_parser::op_table::cast_source_types;
assert!(cast_source_types("i32").count() > 0);
assert_eq!(cast_source_types("not_a_type").count(), 0);