Skip to content

Commit

Permalink
fix compilation issues from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
jmgomez committed Feb 9, 2024
1 parent e39c499 commit 8ac97a1
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions compiler/ccgutils.nim
Original file line number Diff line number Diff line change
Expand Up @@ -172,11 +172,12 @@ proc encodeSym*(m: BModule; s: PSym; makeUnique: bool = false): string =
"N" & encodeName(s.owner.name.s) & encodeName(name) & "E"

proc encodeType*(m: BModule; t: PType): string =
result = ""
var kindName = ($t.kind)[2..^1]
kindName[0] = toLower($kindName[0])[0]
case t.kind
of tyObject, tyEnum, tyDistinct, tyUserTypeClass, tyGenericParam:
encodeSym(m, t.sym)
result = encodeSym(m, t.sym)
of tyGenericInst, tyUserTypeClassInst, tyGenericBody:
result = encodeName(t[0].sym.name.s)
result.add "I"
Expand All @@ -203,11 +204,11 @@ proc encodeType*(m: BModule; t: PType): string =
val.addFloat t.n[1].floatVal
else:
val.add $t.n[0].intVal & "_" & $t.n[1].intVal
encodeName(val)
result = encodeName(val)
of tyString..tyUInt64, tyPointer, tyBool, tyChar, tyVoid, tyAnything, tyNil, tyEmpty:
encodeName(kindName)
result = encodeName(kindName)
of tyAlias, tyInferred, tyOwned:
encodeType(m, t.elementType)
result = encodeType(m, t.elementType)
else:
assert false, "encodeType " & $t.kind
""

0 comments on commit 8ac97a1

Please sign in to comment.