Project

General

Profile

Actions

Bug #17719

closed

Irregular evaluation order in hash literals

Added by nobu (Nobuyoshi Nakada) over 3 years ago. Updated about 3 years ago.

Status:
Closed
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

Like0
Like0Like0Like0Like0