nim-lang / Nim

Nim is a statically typed compiled systems programming language. It combines successful concepts from mature languages like Python, Ada and Modula. Its design focuses on efficiency, expressiveness, and elegance (in that order of priority).
https://nim-lang.org
Other
16.55k stars 1.47k forks source link

using Selectors, Error: undeclared field: 'OSErrorCode' #7667

Closed 2vg closed 5 years ago

2vg commented 6 years ago
import selectors

type
  Data = object
    a: string

var s = newSelector[Data]()

while true:
  var ready = s.select(-1)
prog.nim(10, 16) template/generic instantiation from here
lib/pure/ioselects/ioselectors_epoll.nim(478, 25) template/generic instantiation from here
lib/pure/ioselects/ioselectors_epoll.nim(389, 38) Error: undeclared field: 'OSErrorCode'

see result: https://wandbox.org/permlink/HBffIEUCzjkPaHpV

ghost commented 6 years ago

Can you try to import os module?

dom96 commented 6 years ago

If selectors are importing os then this is a Nim bug. Otherwise it's just a case of adding that import.

dom96 commented 5 years ago

@Araq any ideas? I can see that selectors imports os.