fixes #25726; adds sink/var when match or type param#25779
fixes #25726; adds sink/var when match or type param#25779demotomohiro wants to merge 3 commits into
or type param#25779Conversation
|
Following code compiles without error because proc test(x: var int): typeof(x) =
var y: typeof(x)
return y
var a = 1
echo test(a)In following code, proc test(x: string or var int): typeof(x) =
var y: typeof(x)
return y
var a = 1
echo test(a)Fixing the bug and keep |
|
|
| @@ -0,0 +1,12 @@ | |||
| # issue #25726 | |||
|
|
|||
| proc testOrSink(v: string | sink seq[int]) = | |||
There was a problem hiding this comment.
It makes no sense to allow for inconsistent type modifiers for an or-type. The case we should support is this:
proc testOrSink(v: sink (string | seq[int]))
No description provided.