Skip to content

[PPC0021] - more clarification for the short circuit behavior #63

@rabbiveesh

Description

@rabbiveesh

Given the following code

@{ $possibly_undef?->[0] }[0..10]

What should happen if $possibly_undef is undef? had it been a chain, then it's obvious that the final slice operation would be skipped. Do we want this behavior also in the event that an equivalent expression has been made that just so happens to not be in a "chain"?

I vote yes, b/c the logic for skipping deeper parts of the chain (ostensibly) is "given that i'm trying to fetch some value deep inside this thingy, all fetching of values will be obviously undef, so let's just return undef now". That would apply to this use case also.

I'll happily submit a PR including this as a more peculiar case once i get the feeling that this I am correct that this behavior is correct

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions