pub enum TypeError {
TypeMismatch {
at_node: String,
expected: String,
got: String,
context: Vec<String>,
},
UnknownIdentifier {
at_node: String,
name: String,
},
ArityMismatch {
at_node: String,
expected: usize,
got: usize,
},
NonExhaustiveMatch {
at_node: String,
missing: Vec<String>,
},
UnknownField {
at_node: String,
record_type: String,
field: String,
},
DuplicateField {
at_node: String,
field: String,
},
UnknownVariant {
at_node: String,
constructor: String,
},
EffectNotDeclared {
at_node: String,
effect: String,
},
InfiniteType {
at_node: String,
},
AmbiguousType {
at_node: String,
},
RecursiveTypeWithoutConstructor {
at_node: String,
name: String,
},
RefinementViolation {
at_node: String,
fn_name: String,
param_index: usize,
binding: String,
reason: String,
},
}Variants§
TypeMismatch
UnknownIdentifier
ArityMismatch
NonExhaustiveMatch
UnknownField
DuplicateField
UnknownVariant
EffectNotDeclared
InfiniteType
AmbiguousType
RecursiveTypeWithoutConstructor
RefinementViolation
Refinement-type predicate provably violated at a call site (#209 slice 2). The type checker statically discharged the refinement and found the literal argument doesn’t satisfy the predicate. Slice 3 will add residual runtime checks for arguments that can’t be discharged statically.
Implementations§
Source§impl TypeError
impl TypeError
Sourcepub fn rule_tag(&self) -> &'static str
pub fn rule_tag(&self) -> &'static str
Stable kebab-case identifier for this error variant. See
all_rules for the full catalog.
Sourcepub fn rule_explanation(&self) -> &'static str
pub fn rule_explanation(&self) -> &'static str
Plain-language description of what the rule enforces. Aimed at LLM repair-flow prompts: short enough to inline in a system message, specific enough to suggest the next move.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for TypeError
impl<'de> Deserialize<'de> for TypeError
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Error for TypeError
impl Error for TypeError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl From<TypeError> for PositionedError
impl From<TypeError> for PositionedError
Auto Trait Implementations§
impl Freeze for TypeError
impl RefUnwindSafe for TypeError
impl Send for TypeError
impl Sync for TypeError
impl Unpin for TypeError
impl UnsafeUnpin for TypeError
impl UnwindSafe for TypeError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more