Project

General

Profile

Actions

Feature #11568

closed

Misleading warning for duplicate keys in a hash

Added by sawa (Tsuyoshi Sawada) over 8 years ago. Updated over 8 years ago.

Status:
Closed
Assignee:
-
Target version:
-
[ruby-core:<unknown>]

Description

When a hash literal has duplicate keys as follows,

{
  a: "foo",
  a: "bar",
}

the warning message goes as follows:

warning: duplicated key at line 3 ignored: :a

This message gives the impression as if it is the value "bar" at line 3 that is ignored, even though in reality it is the value "foo" at line 2 that is ignored. It is misleading. I suggest the message to be changed.


Related issues 1 (0 open1 closed)

Is duplicate of Ruby master - Bug #11327: Improve duplicate key warning. Closedzzak (zzak _)Actions
Actions #1

Updated by nobu (Nobuyoshi Nakada) over 8 years ago

  • Is duplicate of Bug #11327: Improve duplicate key warning. added
Actions #2

Updated by nobu (Nobuyoshi Nakada) over 8 years ago

  • Description updated (diff)
  • Status changed from Open to Closed
Actions

Also available in: Atom PDF

Like0
Like0Like0