mirror of
https://github.com/nim-lang/Nim.git
synced 2026-06-06 11:54:11 +00:00
Bugfix: aliases to generic types were not considered implicit generic parameters
This commit is contained in:
@@ -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)
|
||||
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user