Skip to content

Allow auto literals for indices to update andarray_slice #4160

@mikex-oss

Description

@mikex-oss

What's hard to do? (limit 100 words)

Discussed in review of #3814, it feels like we should be able to write stuff like:

update(my_array, 1, val).

With the above change, you now must specify update(my_array, u32:1, val) to avoid errors like:

 TypeInferenceError: Could not infer parametric(s): N of function `array_slice`

Current best alternative workaround (limit 100 words)

Explicitly annotate the index.

Your view of the "best case XLS enhancement" (limit 100 words)

The literal should be promoted to a sensible type, maybe u32 for now, since that's what we use for parametrics.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions