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

Owner: Nobody
Requestors: rob [at] hoelz.ro
Cc:
AdminCc:

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



Subject: Closure parameter call site types should be checked at compile time if possible
Download (untitled) / with headers
text/plain 100b
The following should fail to compile, even if foo is never called: sub foo(&cb:(Str)) { cb(1) }
Still NYI (2017.11, HEAD(5929887)).

The logic behind this ticket is correct, because we already do this:

Code:
sub foo(Str $x) {}; foo(3)

Result:
Show quoted text
===SORRY!=== Error while compiling -e
Calling foo(Int) will never work with declared signature (Str $x)
at -e:1
------> sub foo(Str $x) {}; ⏏foo(3)

On 2014-12-16 20:28:09, rob@hoelz.ro wrote:
Show quoted text
> The following should fail to compile, even if foo is never called:
>
> sub foo(&cb:(Str)) {
> cb(1)
> }



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