SSPkrolik / nimongo

Pure Nim lang MongoDB driver
http://sspkrolik.github.io/nimongo
MIT License
101 stars 20 forks source link

Compile error on latest version of Nim #79

Open ghost opened 4 years ago

ghost commented 4 years ago

Describe the bug I get error the following when compiling a nim file containing identical code to the first example given in the README:

/home/<me>/kohn/kohn.nim(27, 22) Error: type mismatch: got <MongoBase>
but expected one of: 
proc connect(socket: AsyncFD; address: string; port: Port; domain = Domain.AF_INET): owned(
    Future[void])
  first type mismatch at position: 1
  required type for socket: AsyncFD
  but expression 'm' is of type: MongoBase
proc connect(am: AsyncMongo): Future[bool]
  first type mismatch at position: 1
  required type for am: AsyncMongo
  but expression 'm' is of type: MongoBase
proc connect(m: Mongo): bool
  first type mismatch at position: 1
  required type for m: Mongo
  but expression 'm' is of type: MongoBase

expression: connect(m)

To Reproduce

  1. Ensure that you are using Nim 1.0.2
  2. Compile the example code given (substitute in collections)

Expected behavior It should compile without error.

Desktop: