Project

General

Profile

Actions

Bug #17719

open

Irregular evaluation order in hash literals

Added by nobu (Nobuyoshi Nakada) 7 months ago. Updated 1 day ago.

Status:
Open
Priority:
Normal
Assignee:
-
Target version:
-
[ruby-core:102831]

Description

mame (Yusuke Endoh) pointed out an irregular evaluation order example.

$ ruby -e '{foo:p(1), bar:p(2), foo:p(3)}'
-e:1: warning: key :foo is duplicated and overwritten on line 1
1
3
2

It feels like a bug.
https://github.com/nobu/ruby/tree/duplicated-keys-order

Or, probably it would be better to turn into an error?

Actions

Also available in: Atom PDF