Add testcases for #11811 and #14315 (#14726)

* Add testcase for #11811

* Add testcase for #14315
This commit is contained in:
Clyybber 2020-06-19 14:56:38 +02:00 • committed by GitHub
commit 45d1e55e72
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 1 deletions

View file

@ -4,6 +4,7 @@ output: '''
1 1
1 1
1 1
5
''' '''
""" """
@ -65,3 +66,13 @@ block tmixin:
Foo(a) Foo(a)
Foo(b) Foo(b)
# issue #11811
proc p(a : int) =
echo a
proc printVar*[T:int|float|string](a : T) =
bind p
p(a)
printVar(5)

View file

@ -155,3 +155,13 @@ proc caseobj_test_sink: TCaseObj =
echo "---" 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