Skip to content

(;) returns nothing rather than empty named tuple #30115

@piever

Description

@piever

Intuitively I would have imagined that (;) would be the syntax for the empty NamedTuple, whereas it returns nothing instead. After posting it on slack it seems that the rationale is that it is parsing as a concatenation of expressions. For example (1;) returns 1, so (;) should return the value of the first expression which is nothing.

I'm not sure which is more intuitive but maybe it could be changed to return NamedTuple(). The change in technically breaking though I imagine in practice very little code will rely on (;) === nothing

Metadata

Metadata

Assignees

Labels

bugIndicates an unexpected problem or unintended behaviorminor changeMarginal behavior change acceptable for a minor releaseneeds decisionA decision on this change is neededparserLanguage parsing and surface syntax

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions