Skip to content

Conversation

@andremedeiros
Copy link

This change rephrases the duplicate key warning from this:

/Users/andre/bug.rb:4: warning: duplicated key at line 5 ignored: :max_instances

which causes some confusion, to:

/Users/andre/bug.rb:4: warning: key :max_instances is duplicated and overwritten on line 5

/cc @ko1 @tenderlove @rafaelfranca

@drbrain
Copy link
Member

drbrain commented Jun 17, 2015

Your message adds "clobber" which isn't used anywhere else in the core library. I think we should avoid adding new words in errors and warnings to make ruby easier to use for non-english speakers.

What about key :max_instances is duplicated on line 5

@andremedeiros
Copy link
Author

Agreed, although I'd also like to convey that it overwrites the previous value.

This change rephrases the duplicate key warning from this:

```
/Users/andre/bug.rb:4: warning: duplicated key at line 5 ignored: :max_instances
```

which causes some confusion, to:

```
/Users/andre/bug.rb:4: warning: key :max_instances is duplicated and overwritten on line 5
```
@andremedeiros
Copy link
Author

Alright, changed it so that it informs that the key is duplicated AND that it gets overwritten.

@drbrain
Copy link
Member

drbrain commented Jun 17, 2015

I like the updated message.

@andremedeiros
Copy link
Author

:shipit: 😄

@jrafanie
Copy link
Contributor

I ❤️ this change. I've recently seen this warning and had to read it a few times to decipher it. The new warning is easier for me to understand.

@zzak zzak closed this in d5e6c16 Jul 9, 2015
nurse pushed a commit to nurse/ruby that referenced this pull request Sep 18, 2015
  [Fix rubyGH-938] ruby#938 [Bug ruby#11327]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51196 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants