Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:103038 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 97339 invoked from network); 3 Aug 2018 18:47:45 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Aug 2018 18:47:45 -0000 Authentication-Results: pb1.pair.com smtp.mail=mail@pmmaga.net; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=mail@pmmaga.net; sender-id=pass Received-SPF: pass (pb1.pair.com: domain pmmaga.net designates 149.210.149.73 as permitted sender) X-PHP-List-Original-Sender: mail@pmmaga.net X-Host-Fingerprint: 149.210.149.73 outbound2.mail.transip.nl Received: from [149.210.149.73] ([149.210.149.73:33804] helo=outbound2.mail.transip.nl) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 99/BE-59628-D43A46B5 for ; Fri, 03 Aug 2018 14:47:43 -0400 Received: from submission4.mail.transip.nl (submission4.mail.transip.nl [149.210.149.124]) by outbound2.mail.transip.nl (Postfix) with ESMTP id 41hwyf4X04zZw94 for ; Fri, 3 Aug 2018 20:47:38 +0200 (CEST) Received: from mail-wm0-f50.google.com (mail-wm0-f50.google.com [74.125.82.50]) by submission4.mail.transip.nl (Postfix) with ESMTPA id 41hwyc3pSZznTdV for ; Fri, 3 Aug 2018 20:47:35 +0200 (CEST) Received: by mail-wm0-f50.google.com with SMTP id o18-v6so7472474wmc.0 for ; Fri, 03 Aug 2018 11:47:35 -0700 (PDT) X-Gm-Message-State: AOUpUlEWQfzvsvqTW0+23DwyBqMq+AmkEmJ4PB4B1YPl6n+6F5Z7w/8y z/qNlCKe/vMWvlpAez4KLFYd+Z/E50lCFNYLzm8= X-Google-Smtp-Source: AAOMgpeDt8w7RcwV8Y54vGJJiXLKV+vIag5Su1n4rAVd4P24GMci0LPJLo4to8TWfNt15aTjGuQBNvw2ePzZQ00lSM8= X-Received: by 2002:a1c:b58e:: with SMTP id e136-v6mr5408108wmf.141.1533322054736; Fri, 03 Aug 2018 11:47:34 -0700 (PDT) MIME-Version: 1.0 References: <23921b52-76a1-f578-cf1d-568095c8a343@gmx.de> In-Reply-To: <23921b52-76a1-f578-cf1d-568095c8a343@gmx.de> Date: Fri, 3 Aug 2018 19:47:24 +0100 X-Gmail-Original-Message-ID: Message-ID: To: "Christoph M. Becker" Cc: PHP internals Content-Type: multipart/alternative; boundary="0000000000006628b905728c5cef" X-Scanned-By: ClueGetter at submission4.mail.transip.nl DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=transip-a; d=pmmaga.net; t=1533322058; h=from:reply-to:subject:to: cc:references:in-reply-to:date:mime-version:content-type; bh=6sp6eI60DuJx+wkHYhJhAxBc5v3Xztwbg3ec1bfDKAk=; b=QMWz+IVFt5TLp20H16FTA2/DtshOiJsphPR2XQWjj4MQP1lIj8a4oBUkDKSWRiX3nIwS4G Et7V1m+4TNPTUDKK4ONX/tRlO7p5GlbQF7Pue/+Zph7hyt6iZCZ94z/sjezXp3DgzWxxKX zFAR8tE537hwrkDJ1iB9U7CycIE9cDHNz2hwC++51OClAEAJfj8ogYWItHRqTeLOdS40NE IaPYhidLAJRP5cSIIE23NeQovStfH9okYRvlvhCEXHAdRr0TlHoWMnge9HUpiIgLWNoRK1 zfpIQeEeQJslUK7EOunA7OAUdFuXsE3BiDV6JCTWFuHTWULsIWQkoGXP0tLnBg== X-Report-Abuse-To: abuse@transip.nl Subject: Re: On abstract methods defined on traits From: mail@pmmaga.net (=?UTF-8?Q?Pedro_Magalh=C3=A3es?=) --0000000000006628b905728c5cef Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Aug 3, 2018 at 7:22 PM Christoph M. Becker wrote: > On 03.08.2018 at 19:08, Pedro Magalh=C3=A3es wrote: > > What currently happens is that (like with normal methods), the method o= n > > the receiving class is used and the method from the trait is simply > ignored. > > Yes. However, if the class using the trait would not implement the > method, a compile time error would be thrown. > Not really, I mean, the error you get is that you are declaring an abstract method in a non abstract class. If the receiving class is abstract, this works as expected (https://3v4l.org/QdHBo) and nothing is imposed on the receiving class. I think this is also what Levi is referring to. (Correct me if I'm wrong) > > Although this can be fixed, I wanted your opinion on it as this would b= e > > the only thing from traits that would impose anything on the receiving > > class and conflicts with the normal precedence rules. > > Frankly, I don't understand what this bug report is about, > looks pretty much expected (note that the error > message is totally different from what has been reported; there is no > class D in the reproduce script). > Yes, the report is not very clear. But if we follow the docs logic, A::values in your example should fail to compile as it doesn't have the same signature (return type) as the method from the trait T. Regards, Pedro --0000000000006628b905728c5cef--