diff options
author | Zahary Karadjov <zahary@gmail.com> | 2016-08-11 09:09:15 +0300 |
---|---|---|
committer | Zahary Karadjov <zahary@gmail.com> | 2017-03-24 16:58:15 +0200 |
commit | 0b0a3e5f203f6b21f3790a6cd50ceeaa8786badc (patch) | |
tree | 09997fc97481b1bbea0105f9c1e2ab48e7c8674b /compiler/vmdeps.nim | |
parent | 77a4512ae8e6e81173a0f3a862c51dc2308dc76c (diff) | |
download | Nim-0b0a3e5f203f6b21f3790a6cd50ceeaa8786badc.tar.gz |
support derived values in non-generic user type classes
Diffstat (limited to 'compiler/vmdeps.nim')
-rw-r--r-- | compiler/vmdeps.nim | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/compiler/vmdeps.nim b/compiler/vmdeps.nim index 7094d174b..8c7388643 100644 --- a/compiler/vmdeps.nim +++ b/compiler/vmdeps.nim @@ -175,7 +175,7 @@ proc mapTypeToAstX(t: PType; info: TLineInfo; result.add mapTypeToAst(t.sons[i], info) else: result = mapTypeToAstX(t.lastSon, info, inst, allowRecursion) - of tyGenericBody, tyOrdinal, tyUserTypeClassInst: + of tyGenericBody, tyOrdinal: result = mapTypeToAst(t.lastSon, info) of tyDistinct: if inst: @@ -285,9 +285,12 @@ proc mapTypeToAstX(t: PType; info: TLineInfo; of tyProxy: result = atomicType("error", mNone) of tyBuiltInTypeClass: result = mapTypeToBracket("builtinTypeClass", mNone, t, info) - of tyUserTypeClass: - result = mapTypeToBracket("concept", mNone, t, info) - result.add t.n.copyTree + of tyUserTypeClass, tyUserTypeClassInst: + if t.isResolvedUserTypeClass: + result = mapTypeToAst(t.lastSon, info) + else: + result = mapTypeToBracket("concept", mNone, t, info) + result.add t.n.copyTree of tyCompositeTypeClass: result = mapTypeToBracket("compositeTypeClass", mNone, t, info) of tyAnd: result = mapTypeToBracket("and", mAnd, t, info) |