Skip to content

formatter (and parser?) ambiguity with nested parameteric function invocation #1983

Open
@proppy

Description

@proppy

Describe the bug

It seems that the formatter (and possibly) the parser have issues resolving the ambiguities w/ nested parametrics function invocation.

To Reproduce

I've seen it w/ assert_eq, ex:

assert_eq(function_name<SOME_CONST, some_module::SOME_CONST_STRUCT.some_field>(some_param, another_param), some_expected_result);

That get formatted as:

assert_eq(
  function_name < SOME_CONST, some_module::SOME_CONST_STRUCT.some_field > (some_param, another_param),
  some_expected_result);

and treat the parametric function invocation as 3 parameters to assert_eq

  • function_name < SOME_CONST: comparison between two scalar
  • some_module::SOME_CONST_STRUCT.some_field > (some_param, another_param): comparison between a scalar and a tuple
  • some_expected_result

The interpreter also throw:

`function_name` is  parametric function, but it is not being invoked

or

TypeInferenceError: Cannot use operator `<` on functions

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working or is incorrectdslxDSLX (domain specific language) implementation / front-enddslx:fmtDSLX auto-formatter🧦 sox

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions