forked from nim-lang/Nim
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix const in async regression (nim-lang#21898)
* Add test case for a const being used inside an async proc * Use `typeof` to get the type of the block instead of overloaded templates This removes the problem with the symbol having different types I am unsure why I didn't use this in the first place. IIRC I had problems with `typeof` when I first tried to use it in the original implementation
- Loading branch information
1 parent
b7925bf
commit a8718d8
Showing
2 changed files
with
18 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
discard """ | ||
output: "@[97]\ntrue" | ||
""" | ||
|
||
import asyncdispatch | ||
|
||
proc test(): Future[bool] {.async.} = | ||
const S4 = @[byte('a')] | ||
echo S4 | ||
return true | ||
|
||
echo waitFor test() | ||
|