Skip to content

Can't pass empty list to an parameter which is annotated with list<string> #11595

Closed

Description

@WindSoilder

Describe the bug

As title, It's discovered by @amtoine

How to reproduce

  1. def foo [x: list<string>] {}; foo []

It raises a can't convert errror:

Error: nu::shell::cant_convert

  × Can't convert to list<string>.
   ╭─[entry #7:1:1]
 1 │ def foo [x: list<string>] {}; foo []
   ·                                   ─┬
   ·                                    ╰── can't convert list<any> to list<string>
   ╰────

Expected behavior

Expect nu to not raise error.

Screenshots

No response

Configuration

key value
version 0.89.1
branch nightly
commit_hash ea1bd9f
build_os macos-x86_64
build_target x86_64-apple-darwin
rust_version rustc 1.73.0 (cc66ad468 2023-10-03)
rust_channel 1.73.0-x86_64-apple-darwin
cargo_version cargo 1.73.0 (9c4383fb5 2023-08-26)
build_time 2024-01-21 01:48:43 +00:00
build_rust_channel release
allocator mimalloc
features dataframe, default, extra, sqlite, static-link-openssl, trash, which, zip
installed_plugins

Additional context

No response

Activity

  1. added
    status:needs-triage
    on Jan 21, 2024
  2. added a commit that references this issue on Jan 26, 2024
    56acebb
  3. added this to the v0.90.0 milestone on Jan 26, 2024
  4. added a commit that references this issue on Feb 20, 2024
    0d395ac
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

    status:needs-triage

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions