support for inferring static[T] concept params

This commit is contained in:
Zahary Karadjov 2016-08-02 05:15:19 +03:00
commit 76c663f692
8 changed files with 144 additions and 28 deletions

View file

@ -490,6 +490,7 @@ type
tfHasStatic
tfGenericTypeParam
tfImplicitTypeParam
tfInferrableStatic
tfWildcard # consider a proc like foo[T, I](x: Type[T, I])
# T and I here can bind to both typedesc and static types
# before this is determined, we'll consider them to be a
@ -1073,6 +1074,9 @@ proc isMetaType*(t: PType): bool =
(t.kind == tyStatic and t.n == nil) or
tfHasMeta in t.flags
proc isUnresolvedStatic*(t: PType): bool =
return t.kind == tyStatic and t.n == nil
proc linkTo*(t: PType, s: PSym): PType {.discardable.} =
t.sym = s
s.typ = t