@@ -7,12 +7,11 @@ my constant $Lock = Lock.new;
77# | generate an indirect reference to ourselves
88method ind-ref returns IndRef {
99 given $ . obj-num {
10- $ _
11- ?? ($ _ < 0
12- ?? die " indirect object has not been allocated"
13- !! : ind-ref[ $ _ , $ . gen-num ]
14- )
15- !! die " not an indirect object" ;
10+ die " not an indirect object" unless . so ;
11+ die " indirect object has not been allocated"
12+ if $ _ < 0 ;
13+
14+ : ind-ref[ $ _ , $ . gen-num ]
1615 }
1716}
1817
@@ -131,11 +130,6 @@ my class COSAttr {
131130 || ($ ! type ~~ Associative [Mu ] && $ lval ~~ Hash ) {
132131 self ! tie-container: $ lval , : $ check ;
133132 }
134- elsif $ lval . isa (array) && $ ! type ~~ Positional [Numeric ] {
135- # assume numeric. not so easy to type-check atm
136- # https://github.com/rakudo/rakudo/issues/4485
137- # update: fixed as of Rakudo 2021.08
138- }
139133 else {
140134 my \of-type = $ ! decont ?? $ ! type . of !! $ ! type ;
141135 unless $ lval ~~ of-type {
@@ -151,7 +145,8 @@ my class COSAttr {
151145 }
152146 $ lval ;
153147 }
154- multi method tie ($ lval is rw , : $ check ) is rw {
148+
149+ multi method tie ($ lval is rw , : check($)) is rw {
155150 $ Lock . protect: {
156151 $ lval . obj-num // = -1
157152 } if $ . is-indirect && $ lval ~~ PDF::COS;
0 commit comments