From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on starla X-Spam-Level: X-Spam-Status: No, score=-1.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 Received: from nue.mailmanlists.eu (nue.mailmanlists.eu [IPv6:2a01:4f8:1c0c:6b10::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 889F41F44D for ; Thu, 14 Mar 2024 11:25:47 +0000 (UTC) Authentication-Results: dcvr.yhbt.net; dkim=pass (1024-bit key; secure) header.d=ml.ruby-lang.org header.i=@ml.ruby-lang.org header.a=rsa-sha256 header.s=mail header.b=SPZObIP9; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=ruby-lang.org header.i=@ruby-lang.org header.a=rsa-sha256 header.s=s1 header.b=NZScsS4w; dkim-atps=neutral Received: from nue.mailmanlists.eu (localhost [127.0.0.1]) by nue.mailmanlists.eu (Postfix) with ESMTP id 23DA183389; Thu, 14 Mar 2024 11:25:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ml.ruby-lang.org; s=mail; t=1710415541; bh=UbyBCOtrBZVTztv9BDS4RXIxDC/iaE5WKCIKR9LUS3c=; h=Date:References:To:Reply-To:Subject:List-Id:List-Archive: List-Help:List-Owner:List-Post:List-Subscribe:List-Unsubscribe: From:Cc:From; b=SPZObIP9o+ljhaBX7PAkaDNGHjUQZYsnGjavQGfBiJGVJe7saFyIwMKgMAPXosjuF u+L2rH8WtpHfjf/yMKJibMbpbyAfnc41ePNdEPdq/RX1XJfGWAzlQxATx/ebugo1nb Z9a5vt3L1CYrbnESn/mH6kQbIUfm7eKSI94BPovA= Received: from s.wfbtzhsv.outbound-mail.sendgrid.net (s.wfbtzhsv.outbound-mail.sendgrid.net [159.183.224.104]) by nue.mailmanlists.eu (Postfix) with ESMTPS id 1253B83374 for ; Thu, 14 Mar 2024 11:25:37 +0000 (UTC) Authentication-Results: nue.mailmanlists.eu; dkim=pass (2048-bit key; unprotected) header.d=ruby-lang.org header.i=@ruby-lang.org header.a=rsa-sha256 header.s=s1 header.b=NZScsS4w; dkim-atps=neutral DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ruby-lang.org; h=from:references:subject:mime-version:content-type: content-transfer-encoding:list-id:to:cc:content-type:from:subject:to; s=s1; bh=ktSCw5mhy372ARO36Fsp6b+q7EmynoVqhnJWY9ltW54=; b=NZScsS4wPDam9x8nt3F6xQlVonHgu5Mw6Dka8Y0CXEi+2XdFVq0JSL8m372UTL9v83bV i3Ymduun2KT8qw2G2lLSPlZ2tpV+nEmkxt+ADheid3+Ea8OYCz9Ep/NWevAoZf3n+hPx8U tNIUZ/qJrMWs0G9IBeXulRfHfqFMI1OhCzKoy8n7qmRXRuc+d6Wa7yawKlE8QB4CLqIu2W J2DvOfmUf7v4ktWdw+OTBJZUC+MpDi7ZvHvRsQJQmfcf4dQsDbFAQxRldbUOYBlw2vCH3S eDTkOTZohuJ6/D90NOe9dZEXYTFh2etF2dMvAfxOHCQZqol06tAeEFwqgDkXMuEA== Received: by recvd-6449d6bd6c-r824c with SMTP id recvd-6449d6bd6c-r824c-1-65F2DEB1-3 2024-03-14 11:25:37.100754697 +0000 UTC m=+1258599.139928523 Received: from herokuapp.com (unknown) by geopod-ismtpd-17 (SG) with ESMTP id zN40QktEQCm5Ufyf4unZdw for ; Thu, 14 Mar 2024 11:25:37.074 +0000 (UTC) Date: Thu, 14 Mar 2024 11:25:37 +0000 (UTC) Message-ID: References: Mime-Version: 1.0 X-Redmine-Project: ruby-master X-Redmine-Issue-Tracker: Bug X-Redmine-Issue-Id: 20337 X-Redmine-Issue-Author: Eregon X-Redmine-Issue-Priority: Normal X-Redmine-Sender: Eregon X-Mailer: Redmine X-Redmine-Host: bugs.ruby-lang.org X-Redmine-Site: Ruby Issue Tracking System X-Auto-Response-Suppress: All Auto-Submitted: auto-generated X-Redmine-MailingListIntegration-Message-Ids: 93728 X-SG-EID: =?us-ascii?Q?u001=2EByjZWvxTCjdoV8K03xEuhE7KqN4thWULFLM7+oH78KY30oYB3qFthsDpL?= =?us-ascii?Q?4w4cbYa3ttBh8bAHPOnE=2FkzPba67JNu7Lnrked2?= =?us-ascii?Q?O7K9VQ=2FJax2DXdo5W4PzHc6RZBzdgkc0hFgXmc2?= =?us-ascii?Q?G4Q5PAD4gx65VZotEa+aJIMexxdQPx8IefOwGUv?= =?us-ascii?Q?C=2F5O6W4uw6wKjZUliC3s7jYhnTH8OHEWv1OEbQ=2F?= =?us-ascii?Q?74M0Fgz6e8MUhnl4pHxX36CgcsvOHCPOvRNj9j3?= =?us-ascii?Q?gCX4BURyqfiTW8HMbLv+F4CDQw=3D=3D?= To: ruby-core@ml.ruby-lang.org X-Entity-ID: u001.I8uzylDtAfgbeCOeLBYDww== Message-ID-Hash: ALFRPRJCQQGGN55LXE2AHWAA7RVXPWVE X-Message-ID-Hash: ALFRPRJCQQGGN55LXE2AHWAA7RVXPWVE X-MailFrom: bounces+313651-b711-ruby-core=ml.ruby-lang.org@em5188.ruby-lang.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.3 Precedence: list Reply-To: Ruby developers Subject: [ruby-core:117162] [Ruby master Bug#20337] Complex#inspect mutates the string returned by `real.inspect` List-Id: Ruby developers Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: "Eregon (Benoit Daloze) via ruby-core" Cc: "Eregon (Benoit Daloze)" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Issue #20337 has been updated by Eregon (Benoit Daloze). Same for Complex#to_s. ---------------------------------------- Bug #20337: Complex#inspect mutates the string returned by `real.inspect` https://bugs.ruby-lang.org/issues/20337#change-107251 * Author: Eregon (Benoit Daloze) * Status: Open * ruby -v: ruby 3.2.2 (2023-03-30 revision e51014f9c0) [x86_64-linux] * Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN ---------------------------------------- ``` irb(main):001:0> n = Numeric.new => # irb(main):004:0> class Numeric; def inspect = super.freeze; end => :inspect irb(main):006:0> Complex(n, 1).inspect (irb):6:in `inspect': can't modify frozen String: "#" (FrozenError) from (irb):6:in `
' from /home/eregon/.rubies/ruby-3.2.2/lib/ruby/gems/3.2.0/gems/irb-1.6.2/exe/irb:11:in `' from /home/eregon/.rubies/ruby-3.2.2/bin/irb:25:in `load' from /home/eregon/.rubies/ruby-3.2.2/bin/irb:25:in `
' ``` It feels wrong to mutate the result of inspect at least in general, for instance `true.inspect` is frozen. Discovered by https://github.com/ruby/spec/pull/1142 -- 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/postorius/lists/ruby-core.ml.ruby-lang.org/