bung87 / scorper

scorper is a micro and elegant web framework written in Nim
Apache License 2.0
81 stars 5 forks source link

Error: 'isComplete' can have side effects #17

Closed sdmcallister closed 3 years ago

sdmcallister commented 3 years ago

Can't compile.

code:

import scorper
const port{.intdefine.} = 8888
when isMainModule:
  proc cb(req: Request) {.async.} =
    let headers = {"Content-type": "text/plain"}
    await req.resp("Hello, World!", headers.newHttpHeaders())
  let address = "127.0.0.1:" & $port
  waitFor serve(address, cb)

error:

PS C:\Users\\NimProjects\scorpertests> nim r .\scorpertestss.nim
Hint: used config file 'C:\Users\\Nim\nim-1.4.8\config\nim.cfg' [Conf]
Hint: used config file 'C:\Users\\Nim\nim-1.4.8\config\config.nims' [Conf]
..............................................................................................................
C:\Users\\.nimble\pkgs\scorper-1.0.10\scorper\http\streamserver.nim(912, 6) Error: 'isComplete' can have side effects
bung87 commented 3 years ago

it's fixed in devel, now published to v1.0.11