I find the behavior surprising. Are there any examples of precedence thinkos
that are caught by this?

Added [RFC][@LARRY] tags, with just a little more information I think we'll be
able to close. Maybe.

On 2017-01-03 09:00:06, jn...@jnthn.net wrote:
> On Tue, 03 Jan 2017 04:54:52 -0800, elizabeth wrote:
> > $ 6 'class A { method sink() { say "goodbye" } }; A’
> > WARNINGS for -e:
> > Useless use of constant value A in sink context (line 1)
> >
> > I would expected this to say “goodbye” rather than being silent and
> > issuing a warning. The fact that a class has a specific .sink method
> > indicates that the developer had a plan for functioning in a sink
> > environment. So it should a. call that method and b. not issue a
> > warning.
> >
> I think we consciously decided that use of a type object in sink
> context would always warn (justification is that it's been known to
> catch the odd precedence thinko). Note that with an instance:
>
> $ perl6-m 'class A { method sink() { say "goodbye" } }; A.new'
> goodbye
>
> It does exactly what you expect.
>
> /jnthn

Reply via email to