ummm.. turn out that this cannot solving the problem completely... tried a 
number of variants
    
    
    template rightSize(cap): untyped {.dirty.} =
      # not work in 1.2.6 as declare(table.rightSize) is false
      when declared(tables.rightSize) and (NimMajor,NimMinor) < (1,4):
        tables.rightSize(cap)
      else:
        cap
    
    template rightSize(cap): untyped {.dirty.} =
      # not work in 1.2.6:  undeclared identifier: 'tables'
      when (NimMajor,NimMinor) < (1,4):
        tables.rightSize(cap)
      else:
        cap
    
    template correctSize(cap): untyped {.dirty.} =
      # still showing warning in 1.4.0
      when (NimMajor,NimMinor) < (1,4):
        rightSize(cap)
      else:
        cap
    
    template correctSize(cap): untyped {.dirty.} =
      # still showing warning in 1.4.0
      when declared(tables.rightSize) and (NimMajor,NimMinor) < (1,4):
        tables.rightSize(cap)
      else:
        cap
    
    
    Run

Reply via email to