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

Bind no longer working in generic procs. #11811

Closed
solo989 opened this issue Jul 22, 2019 · 3 comments
Closed

Bind no longer working in generic procs. #11811

solo989 opened this issue Jul 22, 2019 · 3 comments

Comments

@solo989
Copy link
Contributor

solo989 commented Jul 22, 2019

I think you closed my issue prematurely araq.

Your example doesn't work on my compiler.

 proc p(a : int) =
  echo a

proc printVar*[T:int|float|string](a : T) =
  bind p
  p(a)

printVar(5)

gives Error: invalid expression: bind p

Oddly enough if you don't call the printVar at all it doesn't give you an error.

Nim Compiler Version 0.20.2 [Windows: amd64] Compiled at 2019-07-17 Copyright (c) 2006-2019 by Andreas Rumpf

compiled with nim c test.nim

I've actually had this problem for a few versions but I assumed you already knew about it before.

@solo989
Copy link
Contributor Author

solo989 commented Jul 22, 2019

Nim Compiler Version 0.17.0 (2017-05-18) [Windows: amd64]
Copyright (c) 2006-2017 by Andreas Rumpf

also gives Error: invalid expression: bind p

@solo989
Copy link
Contributor Author

solo989 commented Jul 22, 2019

I should have been more explicit before. I was always referring to the bind command not working in generic procs. It works in templates for me but not for procs.

@mratsim
Copy link
Collaborator

mratsim commented Jul 22, 2019

Original issue #11800

@solo989 solo989 closed this as completed Jun 19, 2020
Clyybber added a commit to Clyybber/Nim that referenced this issue Jun 19, 2020
Clyybber added a commit that referenced this issue Jun 19, 2020
* Add testcase for #11811

* Add testcase for #14315
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