I have a compile time proc `p` which I'd like to use in a `static` context:
    
    
    proc p (s:string):NimNode {.compileTime.} =
      bindSym(s)
    
    static:
       let t = "SomeType"
       echo p(t).repr
    
    
    Run

but this errors with:
    
    
    Error: cannot evaluate at compile time: s
    
    
    Run

Changing the argument type to `static` gets past that error but now I am unable 
to call it in a `static` block:
    
    
    proc p(s:static[string]):NimNode {.compileTime.} = ...
    
    static:
       let t = "SomeType"
       echo p(t).repr
    
    
    Run

because `s` in the static block is a `string` and the `p` expects a 
`static[string]`:
    
    
    Error: type mismatch: got <string>
    but expected one of:
    proc p(s: static[string]): NimNode
      first type mismatch at position: 1
      required type for s: static[string]
      but expression 'x' is of type: string
    
    
    Run

I think I maybe missing something basic because I don't see why:

  1. I get the first error message since `p` is clearly in the `compileTime` 
context
  2. I can't pass a string in a `static` block to a `proc` expecting a 
`static[string]` since that seems implied 


Reply via email to