Nikita,

Thanks for the response!

By looking at the diff I see it will only work for type-hints in
> functions/methods. Could we also see something like "$var instanceof
> <ProtoInterface>"? I fear it can't be done this way because of parser
> limitations, but I believe this feature would be as useful as type-hinting
> in functions.
>

Well, we could add a new construct "$var protocolof Proto" or "$var actsasa
Proto" or something. I wouldn't conflate instanceof with this behavior for
two reason: instanceof implies type checking. This is not type checking.
Second, instanceof can be used with a variable ont he right side. SO this
could get awkward...

As to the name of the construct, I am at a loss... But I'm sure we can come
up with something interesting...

Anthony

Reply via email to