{"url":"https://api.github.com/repos/nushell/nushell/issues/3450","repository_url":"https://api.github.com/repos/nushell/nushell","labels_url":"https://api.github.com/repos/nushell/nushell/issues/3450/labels{/name}","comments_url":"https://api.github.com/repos/nushell/nushell/issues/3450/comments","events_url":"https://api.github.com/repos/nushell/nushell/issues/3450/events","html_url":"https://github.com/nushell/nushell/pull/3450","id":896244089,"node_id":"MDExOlB1bGxSZXF1ZXN0NjQ4MzcyMzgw","number":3450,"title":"Improve block params","user":{"login":"sophiajt","id":547158,"node_id":"MDQ6VXNlcjU0NzE1OA==","avatar_url":"https://avatars.githubusercontent.com/u/547158?v=4","gravatar_id":"","url":"https://api.github.com/users/sophiajt","html_url":"https://github.com/sophiajt","followers_url":"https://api.github.com/users/sophiajt/followers","following_url":"https://api.github.com/users/sophiajt/following{/other_user}","gists_url":"https://api.github.com/users/sophiajt/gists{/gist_id}","starred_url":"https://api.github.com/users/sophiajt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sophiajt/subscriptions","organizations_url":"https://api.github.com/users/sophiajt/orgs","repos_url":"https://api.github.com/users/sophiajt/repos","events_url":"https://api.github.com/users/sophiajt/events{/privacy}","received_events_url":"https://api.github.com/users/sophiajt/received_events","type":"User","user_view_type":"public","site_admin":false},"labels":[],"state":"closed","locked":false,"assignees":[],"milestone":null,"comments":0,"created_at":"2021-05-20T03:58:38Z","updated_at":"2023-09-02T16:08:58Z","closed_at":"2021-05-20T04:26:54Z","assignee":null,"author_association":"CONTRIBUTOR","issue_field_values":[],"type":null,"active_lock_reason":null,"draft":false,"pull_request":{"url":"https://api.github.com/repos/nushell/nushell/pulls/3450","html_url":"https://github.com/nushell/nushell/pull/3450","diff_url":"https://github.com/nushell/nushell/pull/3450.diff","patch_url":"https://github.com/nushell/nushell/pull/3450.patch","merged_at":"2021-05-20T04:26:54Z"},"body":"This adds a few improvements inspired by #3446 \r\n\r\n* We don't error if we both infer the $it parameter and have explicit parameters. We should detect this case and error if we can.\r\n\r\nWe will know error if you try to use `$it` and it's not in scope. I've removed some of `$it`'s special treatment now that we've made the conversion over the last ~6 releases.\r\n\r\n* Incorrect blocks should error, for example: [1, 2, 3] | each {|$x + 1}\r\n\r\nMalformed parameter blocks will now error.\r\n\r\nI also added checks for having too many parameters in the `each` case, which uses only one parameter, renamed so tests with old names, and a couple other touchups.","closed_by":{"login":"sophiajt","id":547158,"node_id":"MDQ6VXNlcjU0NzE1OA==","avatar_url":"https://avatars.githubusercontent.com/u/547158?v=4","gravatar_id":"","url":"https://api.github.com/users/sophiajt","html_url":"https://github.com/sophiajt","followers_url":"https://api.github.com/users/sophiajt/followers","following_url":"https://api.github.com/users/sophiajt/following{/other_user}","gists_url":"https://api.github.com/users/sophiajt/gists{/gist_id}","starred_url":"https://api.github.com/users/sophiajt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sophiajt/subscriptions","organizations_url":"https://api.github.com/users/sophiajt/orgs","repos_url":"https://api.github.com/users/sophiajt/repos","events_url":"https://api.github.com/users/sophiajt/events{/privacy}","received_events_url":"https://api.github.com/users/sophiajt/received_events","type":"User","user_view_type":"public","site_admin":false},"reactions":{"url":"https://api.github.com/repos/nushell/nushell/issues/3450/reactions","total_count":0,"+1":0,"-1":0,"laugh":0,"hooray":0,"confused":0,"heart":0,"rocket":0,"eyes":0},"timeline_url":"https://api.github.com/repos/nushell/nushell/issues/3450/timeline","performed_via_github_app":null,"state_reason":null}