ast minor (#16079)
This commit is contained in:
parent
6f1a72069a
commit
6a37c0682a
1 changed files with 1 additions and 0 deletions
|
|
@ -1834,6 +1834,7 @@ proc toVar*(typ: PType; kind: TTypeKind; idgen: IdGenerator): PType =
|
|||
proc toRef*(typ: PType; idgen: IdGenerator): PType =
|
||||
## If ``typ`` is a tyObject then it is converted into a `ref <typ>` and
|
||||
## returned. Otherwise ``typ`` is simply returned as-is.
|
||||
result = typ
|
||||
if typ.skipTypes({tyAlias, tyGenericInst}).kind == tyObject:
|
||||
result = newType(tyRef, nextId(idgen), typ.owner)
|
||||
rawAddSon(result, typ)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue