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

Inconsistent typing error with gensymed var #7937

Closed
endragor opened this issue Jun 1, 2018 · 0 comments

Comments

Projects
None yet
2 participants
@endragor
Copy link
Contributor

commented Jun 1, 2018

Commit 16a42f4

The code below produces:

Error: inconsistent typing for reintroduced symbol 'instInfo': previous type was: tuple[filename: string, line: int, column: int]; new type is: tuple of (string, int, int)

Removing the template overload fixes the error.

template printError(error: typed) =
  # Error: inconsistent typing for reintroduced symbol 'instInfo': previous type was: tuple[filename: string, line: int, column: int]; new type is: tuple of (string, int, int)
  let instInfo {.gensym.} = instantiationInfo()
  echo "Error at ", instInfo.filename, ':', instInfo.line, ": ", error

# Removing this overload fixes the error
template someTemplate(someBool: bool, body) =
  discard

template someTemplate(body) =
  body

proc main() =
  someTemplate:
    printError("ERROR 1")
    printError("ERROR 2")

main()

Araq added a commit that referenced this issue May 13, 2019

@Araq Araq closed this in 2fba65b May 14, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.