# New Ticket Created by mt1957 # Please include the string: [perl #126728] # in the subject line of all future correspondence about this issue. # <URL: https://rt.perl.org/Ticket/Display.html?id=126728 >
Following code generates 'P6opaque: must compose before allocating'. package P { class Regex { has Int $.n; submethod BUILD ( Str :$n ) { die 'Not that one!!!' if $n ~~ m/^ '666' $/; $!n = $n.Int; } } } my P::Regex $r .= new(:n<777>); say $r.n; This error is generated because the matching test is somehow using the class still to be build and not referring to its proper Match/Regex class. Something in the definition of infix:<~~> perhaps. Marcel