Skip to content

[General]: FP::Half declares its parameter N twice #99

Open

Description

@shuklaayush

Problem

FP::Half is declared as

function FP::Half(implicit N : {16, 32, 64}, N : Integer) -> Bits(N)

The parameter list declares N twice, once as an implicit {16, 32, 64} and once as an
explicit Integer. N occurs in no other parameter type, so it cannot be implicit: the language manual allows
implicit only for an argument "used as a size argument in the type of another function
argument", and in particular "if the argument is only used in the return type, then it
cannot be marked as implicit" (ISA_LRM, "Size arguments and implicit arguments").
The caller passes it explicitly: FP::Fixup has
when 0b1011 => r := FP::Half(N);.

Proposed fix

-function FP::Half(implicit N : {16, 32, 64}, N : Integer) -> Bits(N)
+function FP::Half(N : {16, 32, 64}) -> Bits(N)

AI disclosure

Assisted-by: Claude

Claude assisted with source analysis, the proposed correction and drafting this report.
Reviewed with assistance from Codex.

Pinned source: definitions.xml.gz at revision 35eface1b7ee003a1cda95005ec5fd83de658a64.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions