support derived values in non-generic user type classes

This commit is contained in:
Zahary Karadjov 2016-08-11 09:09:15 +03:00
commit 0b0a3e5f20
7 changed files with 59 additions and 47 deletions

View file

@ -428,6 +428,7 @@ const
tyAnd, tyOr, tyNot, tyAnything}
tyMetaTypes* = {tyGenericParam, tyTypeDesc, tyExpr} + tyTypeClasses
tyUserTypeClasses* = {tyUserTypeClass, tyUserTypeClassInst}
type
TTypeKinds* = set[TTypeKind]
@ -471,6 +472,8 @@ type
# can be attached to generic procs with free standing
# type parameters: e.g. proc foo[T]()
# depends on unresolved static params.
tfResolved # marks a user type class, after it has been bound to a
# concrete type (lastSon becomes the concrete type)
tfRetType, # marks return types in proc (used to detect type classes
# used as return types for return type inference)
tfCapturesEnv, # whether proc really captures some environment