Bugfix: aliases to generic types were not considered implicit generic parameters

This commit is contained in:
Zahary Karadjov
2018-04-22 17:26:10 +03:00
parent fb27357b62
commit 509d6e9232
2 changed files with 20 additions and 0 deletions

View File

@@ -887,6 +887,9 @@ proc liftParamType(c: PContext, procKind: TSymKind, genericParams: PNode,
# disable the bindOnce behavior for the type class
result = liftingWalk(paramType.base, true)
of tyAlias:
result = liftingWalk(paramType.base)
of tySequence, tySet, tyArray, tyOpenArray,
tyVar, tyLent, tyPtr, tyRef, tyProc:
# XXX: this is a bit strange, but proc(s: seq)

View File

@@ -0,0 +1,17 @@
discard """
nimout: '''
staticAlialProc instantiated with 4
staticAlialProc instantiated with 6
'''
"""
type
StaticTypeAlias = static[int]
proc staticAliasProc(s: StaticTypeAlias) =
static: echo "staticAlialProc instantiated with ", s + 1
staticAliasProc 1+2
staticAliasProc 3
staticAliasProc 5