Re: [RFC] Pure intersection types

From: Date: Tue, 23 Mar 2021 14:05:41 +0000
Subject: Re: [RFC] Pure intersection types
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-113718@lists.php.net to get a copy of this message
> Should we be planning ahead for some future where union and intersection types can be mixed and > design the reflection API accordingly? I worry that if we have a ReflectionIntersectionType, and a > ReflectionUnionType, that ReflectionIntersectionAndUnionType is just going to make both implementers > and users table-flip. As far as I understood, there is no need for any new "combination" ReflectionType-s. For e.g. "A|(B&C)". There should be a structure like this: ``` ReflectionUnionType<A|(B&C)>#getTypes(): |-- ReflectionType<A> |-- ReflectionIntersectionType<B&C>#getTypes(): |-- ReflectionType<B> |-- ReflectionType<C> ```

« previous php.internals (#113718) next »