Skip to content

Commit

Permalink
test restricting to invalid cases
Browse files Browse the repository at this point in the history
  • Loading branch information
metagn committed Dec 6, 2024
1 parent c59d95c commit 690e2a1
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions compiler/vmdeps.nim
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,9 @@ proc mapTypeToAstX(cache: IdentCache; t: PType; info: TLineInfo;
result = mapTypeToBracket("distinct", mDistinct, t, info)
else:
result = atomicType(t.sym)
# keep original type, t.sym can have type tyGenericBody:
result.typ() = t
if tfFromGeneric in t.flags and t.sym.typ.kind == tyGenericBody:
# keep original type, t.sym can have type tyGenericBody:
result.typ() = t
of tyGenericParam, tyForward:
result = atomicType(t.sym)
of tyObject:
Expand Down Expand Up @@ -193,8 +194,9 @@ proc mapTypeToAstX(cache: IdentCache; t: PType; info: TLineInfo;
result.add copyTree(t.n)
else:
result = atomicType(t.sym)
# keep original type, t.sym can have type tyGenericBody:
result.typ() = t
if tfFromGeneric in t.flags and t.sym.typ.kind == tyGenericBody:
# keep original type, t.sym can have type tyGenericBody:
result.typ() = t
of tyEnum:
result = newNodeIT(nkEnumTy, if t.n.isNil: info else: t.n.info, t)
result.add newNodeI(nkEmpty, info) # pragma node, currently always empty for enum
Expand Down

0 comments on commit 690e2a1

Please sign in to comment.