Skip to content

EmptyDrop and Object indexing #477

@rydrman

Description

@rydrman

liquid-rust version: 0.26.0
rust version: 1.63.0
OS: linux

I've been referencing this page of the liquid docs, and my understanding of the nil and EmptyDrop type is that both of the following should be possible:

{% assign var = value | default: 42 %}
{% assign var = data.value | default: 42 %}

In using liquid-rust, however, I'm finding that the second case fails for me if data.value does not already exist. I get an error like:

liquid: Unknown index
  with:
    variable=data
    requested index=value
    available indexes=other, more_data
from: {% assign var = data["value"] | default : 42%}

I was looking for an existing issue for this but didn't find anything, am I missing something?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions