Skip Menu |
Report information
Id: 130875
Status: open
Priority: 0/
Queue: perl6

Owner: Nobody
Requestors: zefram [at] fysh.org
Cc:
AdminCc:

Severity: (no value)
Tag: Bug
Platform: (no value)
Patch Status: (no value)
VM: (no value)



Date: Mon, 27 Feb 2017 07:54:29 +0000
Subject: [BUG] clashing Nil type constraints incorrectly described
From: Zefram <zefram [...] fysh.org>
To: rakudobug [...] perl.org
Download (untitled) / with headers
text/plain 834b
Show quoted text
> my Int $a of Nil
===SORRY!=== Error while compiling: Mu not allowed here; variable list already declared with type Int at line 2 ------> <BOL>^<EOL> expecting any of: constraint Show quoted text
> my Nil $a of Int
===SORRY!=== Error while compiling: Int not allowed here; variable list already declared with type Mu at line 2 ------> <BOL>^<EOL> expecting any of: constraint In both of these cases of multiple type constraints, the Nil type constraint is incorrectly described as "Mu". The same problem also occurs if both type constraints are specified in the "of" form. The error messages are otherwise correct, and the corresponding messages for other types are correct. A Nil type constraint specified without a clash actually behaves (mostly correctly) as a Nil type constraint, not as a Mu type constraint. -zefram
Date: Mon, 27 Feb 2017 11:06:13 +0100
Subject: Re: [perl #130875] [BUG] clashing Nil type constraints incorrectly described
From: Elizabeth Mattijsen <liz [...] dijkmat.nl>
To: "Zefram (via RT)" <perl6-bugs-followup [...] perl.org>
Download (untitled) / with headers
text/plain 1.2k
Feels to me that Nil should not be allowed as a type constraint at all. Show quoted text
> On 27 Feb 2017, at 09:11, Zefram (via RT) <perl6-bugs-followup@perl.org> wrote: > > # New Ticket Created by Zefram > # Please include the string: [perl #130875] > # in the subject line of all future correspondence about this issue. > # <URL: https://rt.perl.org/Ticket/Display.html?id=130875 > > >
>> my Int $a of Nil
> ===SORRY!=== Error while compiling: > Mu not allowed here; variable list already declared with type Int > at line 2 > ------> <BOL>^<EOL> > expecting any of: > constraint
>> my Nil $a of Int
> ===SORRY!=== Error while compiling: > Int not allowed here; variable list already declared with type Mu > at line 2 > ------> <BOL>^<EOL> > expecting any of: > constraint > > In both of these cases of multiple type constraints, the Nil type > constraint is incorrectly described as "Mu". The same problem > also occurs if both type constraints are specified in the "of" form. > The error messages are otherwise correct, and the corresponding messages > for other types are correct. A Nil type constraint specified without > a clash actually behaves (mostly correctly) as a Nil type constraint, > not as a Mu type constraint. > > -zefram
Date: Mon, 27 Feb 2017 10:23:31 +0000
To: Elizabeth Mattijsen via RT <perl6-bugs-followup [...] perl.org>
Subject: Re: [perl #130875] [BUG] clashing Nil type constraints incorrectly described
From: Zefram <zefram [...] fysh.org>
Download (untitled) / with headers
text/plain 628b
Elizabeth Mattijsen via RT wrote: Show quoted text
>Feels to me that Nil should not be allowed as a type constraint at all.
It's a type. The correct behaviour of it as a type constraint is obvious from that observation, and it does in fact exhibit that correct behaviour. (My "mostly" remark was referring to a problem I thought I was seeing but turned out to be me being misled by [perl #130874], with extra confusion supplied by [perl #130876].) I don't see good grounds to forbid it. Indeed, if it were forbidden then that would be surprising, and you'd have to document how it can't be used in the way that all other types can. -zefram


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org