Skip to content

fix(stdlib): pop also removes last item from type definition#1817

Open
JakubOnderka wants to merge 1 commit into
vectordotdev:mainfrom
JakubOnderka:fix-pop-typedef
Open

fix(stdlib): pop also removes last item from type definition#1817
JakubOnderka wants to merge 1 commit into
vectordotdev:mainfrom
JakubOnderka:fix-pop-typedef

Conversation

@JakubOnderka

Copy link
Copy Markdown
Contributor

Summary

Before

$ int(pop([1,2,3])[2])
function call error for "int" at (0:20): expected integer, got null

After

$ int(pop([1,2,3])[2])

error[E100]: unhandled error
  ┌─ :1:1
  │
1 │ int(pop([1,2,3])[2])
  │ ^^^^^^^^^^^^^^^^^^^^
  │ │
  │ expression can result in runtime error
  │ handle the error case to ensure runtime success
  │
  = see documentation about error handling at https://errors.vrl.dev/#handling
  = learn more about error code 100 at https://errors.vrl.dev/100
  = see language documentation at https://vrl.dev
  = try your code in the VRL REPL, learn more at https://vrl.dev/examples

Change Type

  • Bug fix
  • New feature
  • Non-functional (chore, refactoring, docs)
  • Performance

Is this a breaking change?

  • Yes
  • No

How did you test this PR?

cargo test

Does this PR include user facing changes?

  • Yes. Please add a changelog fragment based on
    our guidelines.
  • No. A maintainer will apply the "no-changelog" label to this PR.

Checklist

@JakubOnderka JakubOnderka requested a review from a team as a code owner June 14, 2026 08:42

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 410329fb2c

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/stdlib/pop.rs Outdated
Comment thread src/stdlib/pop.rs Outdated
@pront

pront commented Jun 16, 2026

Copy link
Copy Markdown
Member

@JakubOnderka codex called out this example. Related to arrays with different lengths.

@pront pront added stdlib: pop VRL stdlib function: pop meta: awaiting author Pull requests that are awaiting their author. labels Jun 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

meta: awaiting author Pull requests that are awaiting their author. stdlib: pop VRL stdlib function: pop

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants