Skip to content

Record mistaken for Closure? #7921

Closed

Description

@bobhy

Describe the bug

Parse problem with records.

How to reproduce

〉let r = {bar: (date now) - 3day}
〉$r
<Closure 109>

Expected behavior

$r should be a record, not a closure.

Screenshots

No response

Configuration

-------------------------------------------- /home/bobhy/src/rust/nushell --------------------------------------------
〉version | transpose key value | to md --pretty

key value
version 0.74.1
branch unicode_escape
commit_hash 719d4ff
build_os linux-x86_64
build_target x86_64-unknown-linux-gnu
rust_version rustc 1.66.1 (90743e729 2023-01-10)
rust_channel 1.66.1-x86_64-unknown-linux-gnu
cargo_version cargo 1.66.1 (ad779e08b 2023-01-10)
pkg_version 0.74.1
build_time 2023-01-28 10:44:52 -05:00
build_rust_channel release
features database, default, trash, which, zip
installed_plugins

Additional context

No response

Activity

  1. fdncred commented on Jan 31, 2023

    @fdncred
    Contributor

    It would be a record if this syntax was used

    let r = {bar: ((date now) - 3day)}
    $r
    ╭─────┬────────────╮
    │ bar │ 3 days ago │
    ╰─────┴────────────╯
  2. added
    A:parser
    semantics
    on Jan 31, 2023
  3. bobhy commented on Jan 31, 2023

    @bobhy
    ContributorAuthor
  4. added a commit that references this issue on Mar 17, 2023
    a8eef9a
  5. added this to the v0.78.0 milestone on Mar 17, 2023
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

    A:parsersemantics

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions