From: "matz (Yukihiro Matsumoto) via ruby-core" Date: 2026-11-19T07:27:53+00:00 Subject: [ruby-core:127614] [Ruby Bug#22469] parse.y hash key does not warn on -0.0 Issue #22469 has been updated by matz (Yukihiro Matsumoto). I agree this is a bug. `0.0` and `-0.0` are the same key in a Hash at runtime, so the parser should warn about the duplicate, both for hash literals and for `when` clauses. The priority is low, though. It only affects a warning, so there is no hurry, and I don't think it needs to be backported. Matz. ---------------------------------------- Bug #22469: parse.y hash key does not warn on -0.0 https://bugs.ruby-lang.org/issues/22469#change-120133 * Author: kddnewton (Kevin Newton) * Status: Open * Backport: 3.3: UNKNOWN, 3.4: UNKNOWN, 4.0: UNKNOWN ---------------------------------------- When generating warnings for duplicate keys (hash keys or case-when clauses) parse.y misses warning on -0.0 and 0.0 because it doesn't normalize it like a Ruby hash does. ``` { 0.0 => 1, -0.0 => 1 } ``` ^-- should warn -- https://bugs.ruby-lang.org/ ______________________________________________ ruby-core mailing list -- ruby-core@ml.ruby-lang.org To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/