Literals aren't treated as literals in format inference, so we can't evaluate certain cases where the default would be clear. For example, A + 1 will densify. This was discovered in https://github.com/willow-ahrens/Finch.jl/pull/465#issuecomment-1996161923. Though that case could be resolved by adding the some rules to Finch about /, we might also want to consider how to get the format inference trait system to understand literals better. It's also unclear whether we should interpret A + 1 as a program that adds the literal 1 to A, or a program that adds an unspecified integer value to A.
(@rule call(/, ~a, ~b::isliteral) => if iszero(b.val) Inf end),
(@rule call(\, ~a::isliteral, ~b) => if iszero(a.val) Inf end),
Literals aren't treated as literals in format inference, so we can't evaluate certain cases where the default would be clear. For example,
A + 1
will densify. This was discovered in https://github.com/willow-ahrens/Finch.jl/pull/465#issuecomment-1996161923. Though that case could be resolved by adding the some rules to Finch about/
, we might also want to consider how to get the format inference trait system to understand literals better. It's also unclear whether we should interpretA + 1
as a program that adds the literal 1 to A, or a program that adds an unspecified integer value to A.