I'm not really sure if I would consider that a bug. b is a bad name for a proc/template anyway. An ambiguous call might improve this though.
this works:
import sequtils
type
Color1 = array[1, int]
Color2 = array[1, int]
Color = Color1 | Color2
Image1 = seq[seq[Color1]]
Image2 = seq[seq[Color2]]
Image = Image1 | Image2
template foo(c: Color) = discard
proc appl(img: Image, k: seq[seq[int]]) =
echo k.foldl(a + b.foldl(a + b), 0)
appl @[@[[1]]], @[@[0]]
