Skip to content

Commit

Permalink
fixes #545
Browse files Browse the repository at this point in the history
  • Loading branch information
demotomohiro committed Feb 18, 2025
1 parent 16d5387 commit e736a88
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/nimony/sem.nim
Original file line number Diff line number Diff line change
Expand Up @@ -633,9 +633,9 @@ proc fetchSym(c: var SemContext; s: SymId): Sym =
proc semBoolExpr(c: var SemContext; n: var Cursor) =
var it = Item(n: n, typ: c.types.autoType)
semExpr c, it
n = it.n
if classifyType(c, it.typ) != BoolT:
buildErr c, it.n.info, "expected `bool` but got: " & typeToString(it.typ)
buildErr c, n.info, "expected `bool` but got: " & typeToString(it.typ)
n = it.n

proc semConstBoolExpr(c: var SemContext; n: var Cursor) =
let start = c.dest.len
Expand Down Expand Up @@ -5257,8 +5257,9 @@ proc semExpr(c: var SemContext; it: var Item; flags: set[SemFlag] = {}) =
literal c, it, c.types.charType
of Ident:
let start = c.dest.len
let s = semIdent(c, it.n, flags)
let s = semIdentImpl(c, it.n, it.n.litId, flags)
semExprSym c, it, s, start, flags
inc it.n
of Symbol:
let start = c.dest.len
let s = fetchSym(c, it.n.symId)
Expand Down

0 comments on commit e736a88

Please sign in to comment.