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

Owner: Nobody
Requestors: jdv79 <justin [at] devuyst.com>
Cc:
AdminCc:

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



Subject: [Bug] parametric role generic type not resolving early enough?
Download (untitled) / with headers
text/plain 553b
Some examples that I expected would be equivalent: 1. WHAT [jdv@wieldy ~]$ perl6 -e 'role Foo[::T] { has Int @.a }; say Foo[Int].new.a.perl' Array[Int].new() [jdv@wieldy ~]$ perl6 -e 'role Foo[::T] { has T @.a }; say Foo[Int].new.a.WHAT' (Array[T]) [jdv@wieldy ~]$ 2. method call on type obj [jdv@wieldy ~]$ perl6 -e 'role Foo[::T] { has Int @.a }; say Foo[Int].new.a.perl' Array[Int].new() [jdv@wieldy ~]$ perl6 -e 'role Foo[::T] { has T @.a }; say Foo[Int].new.a.perl' Method 'perl' not found for invocant of class 'T' in block <unit> at -e:1
Download (untitled) / with headers
text/plain 892b
The first example there should have been: [jdv@wieldy ~]$ perl6 -e 'role Foo[::T] { has Int @.a }; say Foo[Int].new.a.WHAT' (Array[Int]) [jdv@wieldy ~]$ perl6 -e 'role Foo[::T] { has T @.a }; say Foo[Int].new.a.WHAT' (Array[T]) [jdv@wieldy ~]$ Oops. On Fri May 15 11:20:36 2015, jdv79 wrote: Show quoted text
> Some examples that I expected would be equivalent: > > 1. WHAT > > [jdv@wieldy ~]$ perl6 -e 'role Foo[::T] { has Int @.a }; say > Foo[Int].new.a.perl' > Array[Int].new() > [jdv@wieldy ~]$ perl6 -e 'role Foo[::T] { has T @.a }; say > Foo[Int].new.a.WHAT' > (Array[T]) > [jdv@wieldy ~]$ > > 2. method call on type obj > > [jdv@wieldy ~]$ perl6 -e 'role Foo[::T] { has Int @.a }; say > Foo[Int].new.a.perl' > Array[Int].new() > [jdv@wieldy ~]$ perl6 -e 'role Foo[::T] { has T @.a }; say > Foo[Int].new.a.perl' > Method 'perl' not found for invocant of class 'T' > in block <unit> at -e:1
Still reproducible (2017.11,HEAD(e5b660e))

On 2015-05-15 11:25:07, jdv79 wrote:
Show quoted text
> The first example there should have been:
>
> [jdv@wieldy ~]$ perl6 -e 'role Foo[::T] { has Int @.a }; say
> Foo[Int].new.a.WHAT'
> (Array[Int])
> [jdv@wieldy ~]$ perl6 -e 'role Foo[::T] { has T @.a }; say
> Foo[Int].new.a.WHAT'
> (Array[T])
> [jdv@wieldy ~]$
>
> Oops.
>
> On Fri May 15 11:20:36 2015, jdv79 wrote:
> > Some examples that I expected would be equivalent:
> >
> > 1. WHAT
> >
> > [jdv@wieldy ~]$ perl6 -e 'role Foo[::T] { has Int @.a }; say
> > Foo[Int].new.a.perl'
> > Array[Int].new()
> > [jdv@wieldy ~]$ perl6 -e 'role Foo[::T] { has T @.a }; say
> > Foo[Int].new.a.WHAT'
> > (Array[T])
> > [jdv@wieldy ~]$
> >
> > 2. method call on type obj
> >
> > [jdv@wieldy ~]$ perl6 -e 'role Foo[::T] { has Int @.a }; say
> > Foo[Int].new.a.perl'
> > Array[Int].new()
> > [jdv@wieldy ~]$ perl6 -e 'role Foo[::T] { has T @.a }; say
> > Foo[Int].new.a.perl'
> > Method 'perl' not found for invocant of class 'T'
> > in block <unit> at -e: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