Skip to content

“panic: runtime error: index out of range” using a combination of null and splat #24805

@izeau

Description

@izeau

Terraform Version

v0.12.24

Terraform Configuration Files

locals {
  x = concat([1, null]...)
}

Debug Output

https://gist.github.com/izeau/8be4f9671c27a2404eee74ca82a9a29c#file-trace-out

Crash Output

https://gist.github.com/izeau/8be4f9671c27a2404eee74ca82a9a29c#file-crash-log

Expected Behavior

I expected it to fail with an error, but not a panic. The generic one would have been nice:

Invalid value for "seqs" parameter: argument must not be null.

Actual Behavior

💥

Steps to Reproduce

$ terraform console <<< 'concat([1, null]...)'

Additional Context

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    configconfirmeda Terraform Core team member has reproduced this issuecrash

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions