You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But if you use :U instead, then it appears as if the :U is applied to the constraint offered by the sigil (Positional/Associative/Callable) instead of the value it's parametarized with:
17:49 | Zoffix | m: -> Int:U @v { @v[^3] }(my Int:U @)
17:49 | camelia | rakudo-moar c9432c207: OUTPUT: «Parameter '@v' of routine '<anon>' must be a type object of type 'Positional[Int]', not an object instance of type 'Array[Int:U]'. Did you forget a 'multi'? in block <unit> at <tmp> line 1»
1352 @Zoffix │ m: my $b := -> Int:U @v { @v[^3] }; my \a := $b.signature.params.head.type; dd $b(a) │
1352 +camelia │ rakudo-moar c9432c207: OUTPUT: «(Any, Any, Any)»
1353 @Zoffix │ m: -> Int:U %v { %v<a b c> }(my Int:U %) │
1353 +camelia │ rakudo-moar c9432c207: OUTPUT: «Parameter '%v' of routine '<anon>' must be a type object of type 'Associative[Int]', not an object instance of type │
│ 'Hash[Int:U]'. Did you forget a 'multi'? in block <unit> at <tmp> line 1»
1354 @Zoffix │ m: -> Int:U &v { }(sub (--> Int:U) {}) │
1354 +camelia │ rakudo-moar c9432c207: OUTPUT: «Parameter '&v' of routine '<anon>' must be a type object of type 'Callable[Int]', not an object instance of type │
│ 'Sub+{Callable[Int:U]}'. Did you forget a 'multi'? in block <unit> at <tmp> line 1»
The text was updated successfully, but these errors were encountered:
If you parametarize with a
:D
constraint, everything is peachy:But if you use
:U
instead, then it appears as if the:U
is applied to the constraint offered by the sigil (Positional
/Associative
/Callable
) instead of the value it's parametarized with:The text was updated successfully, but these errors were encountered: