Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return correct type definition for queries #6361

Closed
JeanMertz opened this issue Feb 5, 2021 · 1 comment · Fixed by #6468
Closed

Return correct type definition for queries #6361

JeanMertz opened this issue Feb 5, 2021 · 1 comment · Fixed by #6468
Assignees
Labels
domain: vrl Anything related to the Vector Remap Language type: bug A code related bug.

Comments

@JeanMertz
Copy link
Contributor

see: #6353 (comment)

Given this VRL program:

foo = [{ "foo": to_string!(1) }]
bar = foo[0].foo
upcase(bar)

This should be an infallible program, as we know the variable bar always resolves to a string.

@JeanMertz JeanMertz added type: bug A code related bug. domain: vrl Anything related to the Vector Remap Language labels Feb 5, 2021
@JeanMertz JeanMertz self-assigned this Feb 15, 2021
@JeanMertz
Copy link
Contributor Author

Tested this in the CLI on master, and this is still an issue that needs to be solved:

foo = [{ "foo": to_string(1) }]
bar = foo[0].foo
upcase(bar)
error[E110]: invalid argument type
  ┌─ :1:8
  │
1 │ upcase(bar)
  │        ^^^
  │        │
  │        this expression resolves to the exact type "null"
  │        but the parameter "value" expects the exact type "string"
  │
  = see language documentation at: https://vector.dev/docs/reference/vrl/
  = learn more at: https://errors.vrl.dev/110

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain: vrl Anything related to the Vector Remap Language type: bug A code related bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant