Bugfix: aliases to generic types were not considered implicit generic parameters
This commit is contained in:
parent
fb27357b62
commit
509d6e9232
2 changed files with 20 additions and 0 deletions
|
|
@ -887,6 +887,9 @@ proc liftParamType(c: PContext, procKind: TSymKind, genericParams: PNode,
|
||||||
# disable the bindOnce behavior for the type class
|
# disable the bindOnce behavior for the type class
|
||||||
result = liftingWalk(paramType.base, true)
|
result = liftingWalk(paramType.base, true)
|
||||||
|
|
||||||
|
of tyAlias:
|
||||||
|
result = liftingWalk(paramType.base)
|
||||||
|
|
||||||
of tySequence, tySet, tyArray, tyOpenArray,
|
of tySequence, tySet, tyArray, tyOpenArray,
|
||||||
tyVar, tyLent, tyPtr, tyRef, tyProc:
|
tyVar, tyLent, tyPtr, tyRef, tyProc:
|
||||||
# XXX: this is a bit strange, but proc(s: seq)
|
# XXX: this is a bit strange, but proc(s: seq)
|
||||||
|
|
|
||||||
17
tests/statictypes/tstatictypes.nim
Normal file
17
tests/statictypes/tstatictypes.nim
Normal 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
|
||||||
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue