Skip to content

Potential performance improvements of the parser: delay type widening in parse_list_expression and parse_table_expression #17776

@blindFS

Description

@blindFS

Basics

  • I have done a basic search through the issue tracker to find similar or related issues.
  • I have made myself familiar with the available features of Nushell for the particular area this enhancement request touches.

Related problem

let foo: list<any> = [1 2 3 a b c] currently triggers type widening when parsing the list expression, then the widened list<oneof<int, string>> is abandoned because there's an explicit type annotation list<any> in the assignment.

I would say most of the widened types are useless, and should only be computed when being checked against something non-trivial.

Describe the solution you'd like

#17575 (comment)

That strategy seems better suited for new-nu-parser.
Nu-parser probably needs more tweaks.

Describe alternatives you've considered

No response

Additional context and details

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions