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

Owner: Nobody
Requestors: vittore.scolari [at] gmail.com
Cc:
AdminCc:

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



To: rakudobug [...] perl.org
Date: Sun, 10 Sep 2017 01:00:55 +0200
From: Vittore Scolari <vittore.scolari [...] gmail.com>
Subject: [BUG] Parametric type object passed as literal die with error
Download (untitled) / with headers
text/plain 467b
The following script

role DataNo { method Blob() { my \T = uint8; say T; Blob[T].new; } } my DataNo $a = DataNo.new; say $a.Blob; role Data[::T] { method Blob() { say T; Blob[T].new; } } my Data[uint8] $b = Data[uint8].new; say $b.Blob;
dies with error:
concatenate requires a concrete string, but got null
in any protect at gen/moar/stage2/NQPCORE.setting line 1033

Download (untitled) / with headers
text/plain 787b
Although that particular error message seems to be specific to `Blob`, it also breaks with other parametric roles (such as `Array`), because the generic parameter T of the outer role seems to be passed through without being specialized first. Shorter examples: ➜ role R[::T] { method a { Array[T].new } }; say R[Int].a.perl; No such method 'perl' for invocant of type 'T' in block <unit> at <unknown file> line 1 ➜ role R[::T] { method a { Blob[T].new } }; say R[Int].a.perl; concatenate requires a concrete string, but got null in any protect at gen/moar/stage2/NQPCORE.setting line 1033 in method a at <unknown file> line 1 in block <unit> at <unknown file> line 1 Looks related to https://rt.perl.org/Ticket/Display.html?id=131947 .


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