pub struct AnyPropagationRules { /* private fields */ }Expand description
Rules for any propagation in type checking.
In TypeScript, any is both a top type (everything is assignable to any)
and a bottom type (any is assignable to everything). This struct captures
whether any is allowed to suppress nested structural mismatches by
configuring the subtype engine’s propagation mode.
Implementations§
Source§impl AnyPropagationRules
impl AnyPropagationRules
Sourcepub const fn new() -> Self
pub const fn new() -> Self
Create a new AnyPropagationRules with default settings.
By default, any suppression is enabled for backward compatibility
with existing TypeScript behavior.
Sourcepub const fn strict() -> Self
pub const fn strict() -> Self
Create strict AnyPropagationRules where any does not silence
structural mismatches.
In strict mode, even when any is involved, the type checker will
perform structural checking and report mismatches.
Sourcepub const fn set_allow_any_suppression(&mut self, allow: bool)
pub const fn set_allow_any_suppression(&mut self, allow: bool)
Set whether any is allowed to suppress structural mismatches.
Sourcepub const fn any_propagation_mode(&self) -> AnyPropagationMode
pub const fn any_propagation_mode(&self) -> AnyPropagationMode
Return the propagation mode for any handling in the subtype engine.