mirror of
https://github.com/nim-lang/Nim.git
synced 2026-06-09 05:14:20 +00:00
@@ -4,6 +4,7 @@ output: '''
|
||||
1
|
||||
1
|
||||
1
|
||||
5
|
||||
'''
|
||||
"""
|
||||
|
||||
@@ -65,3 +66,13 @@ block tmixin:
|
||||
|
||||
Foo(a)
|
||||
Foo(b)
|
||||
|
||||
# issue #11811
|
||||
proc p(a : int) =
|
||||
echo a
|
||||
|
||||
proc printVar*[T:int|float|string](a : T) =
|
||||
bind p
|
||||
p(a)
|
||||
|
||||
printVar(5)
|
||||
|
||||
@@ -154,4 +154,14 @@ proc caseobj_test_sink: TCaseObj =
|
||||
|
||||
|
||||
echo "---"
|
||||
discard caseobj_test_sink()
|
||||
discard caseobj_test_sink()
|
||||
|
||||
# issue #14315
|
||||
|
||||
type Vector*[T] = object
|
||||
x1: int
|
||||
# x2: T # uncomment will remove error
|
||||
|
||||
# proc `=destroy`*(x: var Vector[int]) = discard # this will remove error
|
||||
proc `=destroy`*[T](x: var Vector[T]) = discard
|
||||
var a: Vector[int] # Error: unresolved generic parameter
|
||||
|
||||
Reference in New Issue
Block a user