Skip to content

Format Inference doesn't respect literals #467

Open
@willow-ahrens

Description

@willow-ahrens

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 #465 (comment). 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),

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions