Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:107326 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 89800 invoked from network); 26 Sep 2019 11:42:14 -0000 Received: from unknown (HELO php-smtp3.php.net) (208.43.231.12) by pb1.pair.com with SMTP; 26 Sep 2019 11:42:14 -0000 Received: from php-smtp3.php.net (localhost [127.0.0.1]) by php-smtp3.php.net (Postfix) with ESMTP id 6EA202D1FAE for ; Thu, 26 Sep 2019 02:21:35 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp3.php.net X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS3215 2.6.0.0/16 X-Spam-Virus: No Received: from mail-io1-xd2b.google.com (mail-io1-xd2b.google.com [IPv6:2607:f8b0:4864:20::d2b]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp3.php.net (Postfix) with ESMTPS for ; Thu, 26 Sep 2019 02:21:34 -0700 (PDT) Received: by mail-io1-xd2b.google.com with SMTP id a1so4659784ioc.6 for ; Thu, 26 Sep 2019 02:21:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=m9nu2vCZ0QlbWJVeO8GKOVGyS557qJQYaJJOHiRIC60=; b=YmnNeBQUKY/V8R7CRwPjGRTVMWO/CVVq6LDi7KAiKmrYvMBHGuSDrP8oOyrx1HSviY PTJpVGrQXJJL24mfjIfwpHjlAIT/KQWkz9Yv3FnMy9gIsXw7tNDKxWWYfLw9a6D+Gk28 kli7QM+dGXWUBb9B/kpyP6H+Oov2b9ysk1lewzs3IOgfLrQY9vmkSXr5b+xRfUZF+pvc TaAnLrULnm6z30jXGs+1Ct5ne/j/jI3wLZCqti1JPzON2u2y+rC3nt7fo5IyF34mABSx WH8IzDg6yZTbCm1aYNIkRLCcMs3wUqM1GRSz/cnCayCjWGGRQyD5XDmimQEEFg112WoM 8XRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=m9nu2vCZ0QlbWJVeO8GKOVGyS557qJQYaJJOHiRIC60=; b=uTk2SH4C4EDkiqwHsDkewQI4lWYGCE0RW+dpXYE0TkcqEmlnpX9qubWdAP+/QKc0L3 M5uxBrhR5qabdaXPGp4AfVIo4a60vkCXObtO2ni0myxmCTgLykGXU5kJoY1C0Vgab+ly yJ8BOw+6Ir+eXr8deiSBg9MaeOHqjvl7XEJ00uAiKJjgY8zhr78q6DBEk7WCLYoaGB1M WPdjDXXwsyFggpwxZxAY8bttBOOJDoDvS+fmIAyt9zAlOFqrXvcHVLI5qzWTpFH/r08y 7hRLPP5hyGwht+wTPXy5k2USlEpp64E7ovjEHF/HSjNltpY2JG2UZcBDlUJbKrWe5pVb XV1A== X-Gm-Message-State: APjAAAWCwlZWN9guB0+g7rdgiBBlupz+02tW1M8TDt+j9V/6Nj0M+BY/ gIhL4rcPmcWMqMugdowK6mIgfNSSbolrioi+CXc= X-Google-Smtp-Source: APXvYqyS/Z8lVEdP0q1MDerqWDbFwhfmPRK04G/qMjM33HzQjxgMpVgWOPWOKm0RE47mqD8KCd9fntloFpru+GVyzYQ= X-Received: by 2002:a6b:2bc1:: with SMTP id r184mr2488874ior.146.1569489694148; Thu, 26 Sep 2019 02:21:34 -0700 (PDT) MIME-Version: 1.0 References: <1544E25D-630F-4E02-BCF1-1A0DEF1EBD60@gmail.com> In-Reply-To: Date: Thu, 26 Sep 2019 11:21:07 +0200 Message-ID: To: Nikita Popov Cc: Sara Golemon , Claude Pache , Benjamin Morel , PHP internals Content-Type: multipart/alternative; boundary="000000000000b2cf680593714bdd" X-Envelope-From: Subject: Re: [PHP-DEV] [RFC] Union Types v2 From: kjarli@gmail.com (Lynn) --000000000000b2cf680593714bdd Content-Type: text/plain; charset="UTF-8" On Thu, Sep 26, 2019 at 10:06 AM Nikita Popov wrote: > > This RFC is currently held up by a lack of implementation. Once that is > done, the RFC will go forward as-is (barring any novel concerns). Because I > consider it an important part of the overall proposal (*), I will neither > remove the false type, nor split it into a separate vote. People may vote > against the whole RFC if they disagree with this aspect, or any other > aspect of the proposal. > > Regards, > Nikita > > (*) While certainly not the primary reason for why we should support union > types, the reason why I brought this proposal forward at this time > specifically, is that the lack of union types is a blocker for my pet > project of providing comprehensive type annotations for internal functions. > Supporting "false" is strictly necessary for this purpose, because it is > part of nearly all unions as far as internal functions are concerned. > Hi, What if a 'new' type is added specifically to identify this case? Instead of giving it `int|false`, it could be `int|failed`, where `failed` would allow a single value only: false. I like it more than naming the return type `false`. I'm not sure this type should be declarable in user-land, meaning it's limited to the core and a marker for legacy. `failed` (or name it whatever) and `false` would still be identical, yet has a more distinct identification and does not imply there could also a type called `true`. Figured I'd toss in here as an out-of-the-box idea. Regards, Lynn van der Berg --000000000000b2cf680593714bdd--