Skip to content

Deep nil coalescing ??  #573

Open
Open
@antonmedv

Description

@antonmedv

Right now, in order to use ?? user have to use ?. instead of . in nested structures.

events[0]?.labels?.value ?? 'defaul'

My idea is to make left hand side of ?? optional by default. So in case user written:

events[0].labels.value ?? 'defaul'

All member accesses to label/value/events will be optional. As well as array element access.

I really like this idea and think it makes much sense.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions