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

{.reorder: on.} pragma causes import errors #8665

Closed
genotrance opened this issue Aug 16, 2018 · 1 comment
Closed

{.reorder: on.} pragma causes import errors #8665

genotrance opened this issue Aug 16, 2018 · 1 comment

Comments

@genotrance
Copy link
Contributor

Consider:

# a.nim

{.reorder: on.}

type
  abc* = object
    test: def

type
  def = object
    test2: int

Let's import this in another file:

# b.nim

import a

a.nim compiles just fine. But b.nim compilation fails:

> nim c b.nim

Hint: used config file '\nim-0.18.0\config\nim.cfg' [Conf]
Hint: system [Processing]
Hint: b [Processing]
Hint: a [Processing]
a.nim(1, 2) Error: implementation of 'a' expected

I have tested this with #head, 0.18.0 and 0.17.2 and it is still broken. This is gating the libui wrapper I'm working on using nimgen since it has multiple forward declarations and it is not trivial to automate moving around the code to avoid the forward declarations and {.reorder: on.}.

@genotrance genotrance changed the title {.reorder: on.} pragma causes import errors {.reorder: on.} pragma causes import errors Aug 16, 2018
@awr1
Copy link
Contributor

awr1 commented Aug 17, 2018

{.reorder: on.} should also be added to docs

LemonBoy added a commit to LemonBoy/Nim that referenced this issue Aug 20, 2018
Take this into account while searching for undefined forward references.

Fixes nim-lang#8665
Araq pushed a commit that referenced this issue Aug 21, 2018
Take this into account while searching for undefined forward references.

Fixes #8665
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

2 participants