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.
Still have to look this over some. We'll see. I put sink in this branch simply because I saw `tyVar` there and for no other reason. In any case the problem appears to be coming from `liftParamType` as it removes the `sink` type from the formals. nim-lang#23869
- Loading branch information
Showing
2 changed files
with
28 additions
and
2 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,26 @@ | ||
block: | ||
type Head[T] = object | ||
wasc: bool | ||
|
||
proc `=destroy`[T](x: var Head[T]) = | ||
discard | ||
|
||
proc `=copy`[T](x: var Head[T], y: Head[T]) = | ||
x.wasc = true | ||
|
||
proc `=dup`[T](x: Head[T]): Head[T] = | ||
result.wasc = true | ||
|
||
proc update(h: var Head) = | ||
discard | ||
|
||
proc digest(h: sink Head) = | ||
assert h.wasc | ||
|
||
var h = Head[int](wasc: false) | ||
h.digest() # sink h | ||
h.update() # use after sink | ||
|
||
block: | ||
proc two(a: sink auto) =discard | ||
assert typeof(two[int]) is proc(a: sink int) {.nimcall.} |