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 autolearn=ham autolearn_force=no version=3.4.6 Received: from nue.mailmanlists.eu (nue.mailmanlists.eu [94.130.110.93]) (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 B748F1F4BE for ; Mon, 21 Oct 2024 16:49:56 +0000 (UTC) Authentication-Results: dcvr.yhbt.net; dkim=pass (1024-bit key; unprotected) header.d=ml.ruby-lang.org header.i=@ml.ruby-lang.org header.a=rsa-sha256 header.s=mail header.b=HRBUrDQJ; 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=Q0FUqwt8; dkim-atps=neutral DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ml.ruby-lang.org; s=mail; t=1729529364; bh=Q5/ENeHIur232+cgY1QQbLDKdC0KulruJKzJemOvglQ=; 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=HRBUrDQJVtbcohn1XUOnvHUR7mV4b3POVBhkr1tVP3NHtr6ln+UoJN8IWhJ/lU5T2 l/+cV/4Mw0wEXvqCqJFhcGQSMxNiutj2DvGAKBY3anpGnSIld3ExSqDufpv/A/Gj7f MRn/M+aE8vNT+CKKgzDLmfGD/Hz9aaxi5CE13Lkc= Received: from nue.mailmanlists.eu (localhost [IPv6:::1]) by nue.mailmanlists.eu (Postfix) with ESMTP id 86CA74459D for ; Mon, 21 Oct 2024 16:49:24 +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=Q0FUqwt8; dkim-atps=neutral Received: from s.wrqvtbkv.outbound-mail.sendgrid.net (s.wrqvtbkv.outbound-mail.sendgrid.net [149.72.123.24]) by nue.mailmanlists.eu (Postfix) with ESMTPS id 054D24452C for ; Mon, 21 Oct 2024 16:49:13 +0000 (UTC) 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=pRDdgH7Bbdhee8KdLoh5geVlHu2PIo6ZAUkI8bQDWZ8=; b=Q0FUqwt8OkREtHr5A+dfE3KoFPmgdQd/3jh5vgLBy4o/wgB24EKPGCCITNVpcOv8qMqP 1c/RHcxusLBnk6u/hf8WOBZGjcy+r6dyMprkRRUqCl7nvZ2uknjfKQI5GATMwv9B/XbEMb K+7+2yQyuaoxm/oLG3wqUctrcXpZRtr5q3X/K6TbyGXZWZI8885JZ8yFKp+fuF06AMCaq5 cw+AHlLwTfwJ/X2juYspBMkSab3cxTjhxaQQRkFV8GwCdTVgJ+x+2D/Mk7LsURCb7ZZn0o bRMfiPEL+DL+KHb9Zgns21PLVSb9MxNIXlv/clI/6kWL8kcx8T2qoDjh2VL3p2hQ== Received: by recvd-55fc7fd858-h6r4k with SMTP id recvd-55fc7fd858-h6r4k-1-67168606-62 2024-10-21 16:49:10.576273815 +0000 UTC m=+3365518.569371950 Received: from herokuapp.com (unknown) by geopod-ismtpd-19 (SG) with ESMTP id mX-u3fu_TlKx0Bj5LpaZew for ; Mon, 21 Oct 2024 16:49:10.516 +0000 (UTC) Date: Mon, 21 Oct 2024 16:49:10 +0000 (UTC) Message-ID: References: Mime-Version: 1.0 X-Redmine-Project: ruby-master X-Redmine-Issue-Tracker: Bug X-Redmine-Issue-Id: 20808 X-Redmine-Issue-Author: maicolben X-Redmine-Issue-Priority: Normal X-Redmine-Sender: byroot 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: 96212 X-SG-EID: =?us-ascii?Q?u001=2EKmNZ1u3n1vIpO8NNTdp+Q9c0ai7potxbEDLMO7SOJO=2F4KkRUz0d23466m?= =?us-ascii?Q?naiq=2F5fmA4hb60MdRMUAwHZnjIWVFu=2FrqiBOz5c?= =?us-ascii?Q?nOvkBudsSTjq0CVVKtlcbrf4gEvkhs8R2+eg6wL?= =?us-ascii?Q?LX9igpZDB9wc7eCQu4dEAoL=2FZ1waMCiMcIEhZo6?= =?us-ascii?Q?OamZylBAuQW3Av88ueelXPVtlioQyMZAUnra7UC?= =?us-ascii?Q?1MiWzXLLXP86UOoL=2FCsBOKJaTRTPnnJvL4sySXR?= =?us-ascii?Q?6yeb8CaAJjmQBsRfDsZOmoPwPQ=3D=3D?= To: ruby-core@ml.ruby-lang.org X-Entity-ID: u001.I8uzylDtAfgbeCOeLBYDww== Message-ID-Hash: X5EHEN6S34P4QKYUZBCATAL2VZATPGMV X-Message-ID-Hash: X5EHEN6S34P4QKYUZBCATAL2VZATPGMV 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.9 Precedence: list Reply-To: Ruby developers Subject: [ruby-core:119578] [Ruby master Bug#20808] Cannot override Data#inspect List-Id: Ruby developers Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: "byroot (Jean Boussier) via ruby-core" Cc: "byroot (Jean Boussier)" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Issue #20808 has been updated by byroot (Jean Boussier). > Struct and Data both assume all member readers are public: Actually I misread. The `Struct` one uses `Struct#[]` so it would work with Struct. `Data` however has no such method, so two solutions I can think of are: - Use `send`, but only work for private. If instead the method is renamed or removed, it will still fail. - Rescue `NoMethodError`, and skip displaying that field. ---------------------------------------- Bug #20808: Cannot override Data#inspect https://bugs.ruby-lang.org/issues/20808#change-110197 * Author: maicolben (Maicol Bentancor) * Status: Open * ruby -v: 3.3.5 * Backport: 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN ---------------------------------------- Given the next code: ``` Dog = Data.define(:name) do def inspect "Hello!" end private attr_reader :name end Dog.new(name: "Fido") ``` It throws an error: - An error occurred when inspecting the object: # And isn't using my `inspect` function -- 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/