Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chronos/threadsync errors when compiling documentation #499

Open
PhilippMDoerner opened this issue Jan 29, 2024 · 0 comments
Open

chronos/threadsync errors when compiling documentation #499

PhilippMDoerner opened this issue Jan 29, 2024 · 0 comments

Comments

@PhilippMDoerner
Copy link

PhilippMDoerner commented Jan 29, 2024

The Problem

I've recently tried to compile docs of a project of mine which makes use of the chronos/threadsync module in 2 places.

I've come to notice that it is impossible to compile the module docs for any module that imports threadsync.

Minimal example

  1. Have the following nim file
# src/playground.nim
import chronos/threadsync
  1. Run the command nim doc src/playground.nim

The error

This will lead to the following error message:

/home/philipp/dev/playground/nimbledeps/pkgs2/chronos-4.0.0-2b7b9c774b0fb8c3b1d415da6148c8973c4ba81c/chronos/threadsync.nim(138, 12) Error: type mismatch
Expression: contains(loop, fd)
  [1] loop: PDispatcher
  [2] fd: AsyncFD

Expected one of (first mismatch at [position]):
[1] func contains(self: Opt; v: auto): bool
[1] func contains[T](x: set[T]; y: T): bool
[1] proc contains[T](a: openArray[T]; item: T): bool
[1] proc contains[T](deq: Deque[T]; item: T): bool
[1] proc contains[U, V, W](s: HSlice[U, V]; value: W): bool

/home/philipp/dev/playground/nimbledeps/pkgs2/chronos-4.0.0-2b7b9c774b0fb8c3b1d415da6148c8973c4ba81c/chronos/threadsync.nim(138, 21) Error: expression '' has no type (or is ambiguous)
/home/philipp/dev/playground/nimbledeps/pkgs2/chronos-4.0.0-2b7b9c774b0fb8c3b1d415da6148c8973c4ba81c/chronos/threadsync.nim(276, 5) template/generic instantiation of `async` from here
/home/philipp/dev/playground/nimbledeps/pkgs2/chronos-4.0.0-2b7b9c774b0fb8c3b1d415da6148c8973c4ba81c/chronos/threadsync.nim(340, 20) Error: type mismatch
Expression: contains(loop, AsyncFD(eventFd))
  [1] loop: PDispatcher
  [2] AsyncFD(eventFd): AsyncFD

Expected one of (first mismatch at [position]):
[1] func contains(self: Opt; v: auto): bool
[1] func contains[T](x: set[T]; y: T): bool
[1] proc contains[T](a: openArray[T]; item: T): bool
[1] proc contains[T](deq: Deque[T]; item: T): bool
[1] proc contains[U, V, W](s: HSlice[U, V]; value: W): bool

/home/philipp/dev/playground/nimbledeps/pkgs2/chronos-4.0.0-2b7b9c774b0fb8c3b1d415da6148c8973c4ba81c/chronos/threadsync.nim(276, 5) template/generic instantiation of `async` from here
/home/philipp/dev/playground/nimbledeps/pkgs2/chronos-4.0.0-2b7b9c774b0fb8c3b1d415da6148c8973c4ba81c/chronos/threadsync.nim(340, 12) Error: type mismatch: got 'uint8' for 'not' but expected 'bool'
/home/philipp/dev/playground/nimbledeps/pkgs2/chronos-4.0.0-2b7b9c774b0fb8c3b1d415da6148c8973c4ba81c/chronos/threadsync.nim(368, 7) template/generic instantiation of `async` from here
/home/philipp/dev/playground/nimbledeps/pkgs2/chronos-4.0.0-2b7b9c774b0fb8c3b1d415da6148c8973c4ba81c/chronos/threadsync.nim(410, 16) Error: type mismatch
Expression: contains(loop, AsyncFD(eventFd))
  [1] loop: PDispatcher
  [2] AsyncFD(eventFd): AsyncFD

Expected one of (first mismatch at [position]):
[1] func contains(self: Opt; v: auto): bool
[1] func contains[T](x: set[T]; y: T): bool
[1] proc contains[T](a: openArray[T]; item: T): bool
[1] proc contains[T](deq: Deque[T]; item: T): bool
[1] proc contains[U, V, W](s: HSlice[U, V]; value: W): bool

/home/philipp/dev/playground/nimbledeps/pkgs2/chronos-4.0.0-2b7b9c774b0fb8c3b1d415da6148c8973c4ba81c/chronos/threadsync.nim(368, 7) template/generic instantiation of `async` from here
/home/philipp/dev/playground/nimbledeps/pkgs2/chronos-4.0.0-2b7b9c774b0fb8c3b1d415da6148c8973c4ba81c/chronos/threadsync.nim(410, 8) Error: type mismatch: got 'uint8' for 'not' but expected 'bool'
/home/philipp/dev/playground/src/playground.nim(1, 15) Warning: imported and not used: 'threadsync' [UnusedImport]

I'm not entirely sure what this is all about, potentially some macro magic that makes it not find the contains proc via the doc command (?)

PhilippMDoerner added a commit to PhilippMDoerner/ThreadButler that referenced this issue Jan 29, 2024
it breaks doc compilation as per  status-im/nim-chronos#499

Thus it must be hidden with when switches
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant