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

Error: illegal discard proc #9763

Closed
Wh1teDuke opened this issue Nov 20, 2018 · 1 comment
Closed

Error: illegal discard proc #9763

Wh1teDuke opened this issue Nov 20, 2018 · 1 comment

Comments

@Wh1teDuke
Copy link
Contributor

Compiler won't allow to discard a proc returned from another proc

Example

proc foo: (proc: int) =
  proc bar: int = 1
  return bar

discard foo()

Current Output

prog.nim(5, 1) Error: illegal discard proc, did you mean: foo()()

Expected Output

No error. This used to compile.

Additional Information

>nim -v
Nim Compiler Version 0.19.9 [Linux: i386]
Compiled at 2018-11-20
Copyright (c) 2006-2018 by Andreas Rumpf

git hash: e8bec614131957e7bd8b9f377ba4a08aa762309c
active boot switches: -d:release
@krux02
Copy link
Contributor

krux02 commented Nov 20, 2018

duplicate of #9726

@krux02 krux02 closed this as completed Nov 20, 2018
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