allow nat in DeriveInspect

This commit is contained in:
Brendan Hansknecht 2023-11-28 09:20:33 -08:00
parent a1a563074d
commit 35078a2295
No known key found for this signature in database
GPG Key ID: 0EA784685083E75B

View File

@ -859,8 +859,8 @@ impl DerivableVisitor for DeriveInspect {
#[inline(always)]
fn is_derivable_builtin_opaque(symbol: Symbol) -> bool {
(is_builtin_number_alias(symbol) && !is_builtin_nat_alias(symbol))
|| is_builtin_bool_alias(symbol)
// TODO: Should this just be true? All values are always inspectable.
is_builtin_number_alias(symbol) || is_builtin_bool_alias(symbol)
}
#[inline(always)]
@ -927,16 +927,9 @@ impl DerivableVisitor for DeriveInspect {
}
#[inline(always)]
fn visit_alias(var: Variable, symbol: Symbol) -> Result<Descend, NotDerivable> {
fn visit_alias(_var: Variable, symbol: Symbol) -> Result<Descend, NotDerivable> {
if is_builtin_number_alias(symbol) {
if is_builtin_nat_alias(symbol) {
Err(NotDerivable {
var,
context: NotDerivableContext::Encode(NotDerivableEncode::Nat),
})
} else {
Ok(Descend(false))
}
Ok(Descend(false))
} else {
Ok(Descend(true))
}