On Wed, 9 Dec 2020 at 19:48, Mike Schinkel <m...@newclarity.net> wrote:

5. Someone else mentioned shortcut syntax, which I would like to mention
> again, although I realize implement details might make this a non-starter.
>
> So if I have a function that accepts a Size from above, e.g.:
>
> function show(Size $size) {}
>
> Then it would be great if we could call the function like this since its
> parameter was type-hinted:
>
> show(::Medium)
>
> Rather than always having to write:
>
> show(Size::Medium)
>
> So can we consider a shortcut syntax?
>

I'm not sure what value a shortcut syntax would bring, but it would surely
break, or at least make ambiguous, union types:

    function show(Enum1|Enum2 $value)  {}
    show(::Medium)

Which enum would Medium resolve to?

- Benjamin

Reply via email to