mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-30 18:02:05 +00:00
22 lines
370 B
Nim
22 lines
370 B
Nim
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()
|
|
|