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

async call now treated as non-gc safed call? #10795

Closed
slangmgh opened this issue Mar 6, 2019 · 3 comments

Comments

Projects
None yet
2 participants
@slangmgh
Copy link
Contributor

commented Mar 6, 2019

waitFor async call now treated as non-gc safed call in the latest devel branch, is it bug or feature?

Example

import asyncdispatch
import threadpool

proc f1() =
   waitFor sleepAsync(100)
   echo "hello"

spawn f1()

Current Output

t9.nim(11, 9) Error: 'spawn' takes a GC safe call expression

Expected Output


Possible Solution

Additional Information

$ nim -v
Nim Compiler Version 0.19.9 [Windows: i386]
Compiled at 2019-03-06
Copyright (c) 2006-2019 by Andreas Rumpf

active boot switches: -d:release
@Araq

This comment has been minimized.

Copy link
Member

commented Mar 6, 2019

It's a feature, the effect tracking in Nim was wrong. However, this will probably work again after a stdlib patch.

@slangmgh

This comment has been minimized.

Copy link
Contributor Author

commented Mar 6, 2019

Thank you. @Araq

Gc-safe call is difficult to find when it comes and compiler doesn't give any information about which proc is the culprits.

@Araq Araq closed this in 32c9ca6 Mar 6, 2019

@Araq

This comment has been minimized.

Copy link
Member

commented Mar 6, 2019

Gc-safe call is difficult to find when it comes and compiler doesn't give any information about which proc is the culprits.

Oh it's not that bad, annotate proc f1() {.gcsafe.} and repeat until the real problem is listed.

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.