← All docs
trait_exists() — internals
Compiler internals for trait_exists(): lowering path, type checks, and runtime helpers.
trait_exists() — internals
Where it lives
- Signature:
src/builtins/callables/trait_exists.rs - Lowering:
src/codegen/lower_inst/builtins.rs:585 (lower_class_like_exists) - Function symbol:
lower_class_like_exists()
Lowering notes
- Lowers AOT class/interface/enum existence checks for literal or dynamic string names.
Runtime helpers
No direct __rt_* helpers captured — the lowering is inlined or routes through another builtin.
Signature summary
function trait_exists(string $trait, bool $autoload = true): bool
What the type checker enforces
- Arity: takes 1–2 arguments (1 optional).
Eval interpreter (magician)
- Declaration:
crates/elephc-magician/src/interpreter/builtins/symbols/trait_exists.rs(eval_builtin!) - Dispatch hooks:
direct,values