Skip Menu |

This queue is for tickets about the Dios CPAN distribution.

Report information
The Basics
Id: 122739
Status: resolved
Priority: 0/
Queue: Dios

People
Owner: Nobody in particular
Requestors: wrb4181 [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Warning for earlier declare if method param name the same as an attribute name
Date: Mon, 7 Aug 2017 18:21:24 -0400
To: bug-Dios [...] rt.cpan.org
From: William Barker <wrb4181 [...] gmail.com>
Dios-00.2007 Strawberry 5.26.0 Windows 10 64-bit If you 'use warnings' and create an attribute, then that variable will be used within the same lexical scope that method params are used (subroutine signature). Example: use 5.26.0; use warnings; use Dios; class Foo { has Str $.bar; method print ( $foo, $bar, $baz, $qux ) { say $foo; say $bar; say $baz; say $qux; } } 1; However in standard Perl using subroutine signatures this is allowed. Example: use 5.26.0; use warnings; use feature 'signatures'; no warnings qw(experimental::signatures); package Foo { my $bar; sub new { my $class; my $self = {}; bless $self, $class; return $self; } sub print ( $foo, $bar, $baz, $qux ) { say $foo; say $bar; say $baz; say $qux; } } 1;
Subject: Re: [rt.cpan.org #122739] Warning for earlier declare if method param name the same as an attribute name
Date: Mon, 14 Aug 2017 13:47:43 +0200
To: bug-Dios [...] rt.cpan.org
From: Damian Conway <damian [...] conway.org>
Thanks, William. That is indeed annoying. I'm working on a fix, however it will require quite a bit of reorganizing of the code generator (but which, happily, will also make 'has' attributes significantly faster to set up and access). I'll respond again when it's done (this week was the Perl Conference in Amsterdam, and conspiciously lacking in copious free time. ;-) Much appreciated! Damian
Subject: Re: [rt.cpan.org #122739] Warning for earlier declare if method param name the same as an attribute name
Date: Sun, 27 Aug 2017 13:34:34 +0000
To: bug-Dios [...] rt.cpan.org
From: Damian Conway <damian [...] conway.org>
Fixed in the latest release (0.002010). Thanks again, William. Damian