how can i satisfy parallel bounds checker in this example?

it fails with

test.nim(18, 19) Error: cannot prove: y * w8 + x <= len(s) + -1 (bounds check)
    
    
     strutils
    import math
    import threadpool
    {.experimental: "parallel".}
    
    proc getc() : char = 'b'
    
    let
        w = 16
        h = 16
        w8 = ceil(w / 8).int
    
    var s = 'a'.repeat(w8 * h)
    
    for y in 0..<h:
        parallel:
            for x in 0..<w8:
                s[y*w8+x] = spawn getc()
    
    
    
    Run

the example is distilled out of a renderer, where getc is expensive.

Reply via email to