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

Regression in template lookup with generics #2004

Closed
oprypin opened this issue Jan 23, 2015 · 0 comments
Closed

Regression in template lookup with generics #2004

oprypin opened this issue Jan 23, 2015 · 0 comments

Comments

@oprypin
Copy link
Contributor

oprypin commented Jan 23, 2015

type Something = object

proc testA(x: Something) = discard

template def(name: expr) {.immediate.} =
  proc testB[T: Something](x: T) =
    `test name`(x)
def A

var x: Something
testB(x)
  • 0.10.2: works

  • devel:

    (11, 5) Info: instantiation from here
    (7, 15) Error: type mismatch: got (T)
    but expected one of:
    a0.testA(x: Something)
    > Process terminated with exit code 256
    

Obviously, this code is quite pointless, I just oversimplified it.

Adding {.dirty.} makes it work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants