close #1128
This commit is contained in:
parent
79881bfce0
commit
905a22d137
1 changed files with 21 additions and 0 deletions
21
tests/concepts/t1128.nim
Normal file
21
tests/concepts/t1128.nim
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
discard """
|
||||||
|
output: "true\ntrue"
|
||||||
|
"""
|
||||||
|
|
||||||
|
type
|
||||||
|
TFooContainer[T] = object
|
||||||
|
|
||||||
|
TContainer[T] = generic var c
|
||||||
|
foo(c, T)
|
||||||
|
|
||||||
|
proc foo[T](c: var TFooContainer[T], val: T) =
|
||||||
|
discard
|
||||||
|
|
||||||
|
proc bar(c: var TContainer) =
|
||||||
|
discard
|
||||||
|
|
||||||
|
var fooContainer: TFooContainer[int]
|
||||||
|
echo fooContainer is TFooContainer # true.
|
||||||
|
echo fooContainer is TFooContainer[int] # true.
|
||||||
|
fooContainer.bar()
|
||||||
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue