Skip to content

Commit

Permalink
fix test, proper line info
Browse files Browse the repository at this point in the history
  • Loading branch information
metagn committed Sep 8, 2024
1 parent 7d735a2 commit 686584d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion compiler/semdata.nim
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ proc makeNotType*(c: PContext, t1: PType): PType =
result.flags.incl tfHasMeta

proc nMinusOne(c: PContext; n: PNode): PNode =
result = newTreeI(nkCall, n.info, newSymNode(getSysMagic(c.graph, n.info, "pred", mPred)), n)
result = newTreeI(nkCall, n.info, newSymNode(getSysMagic(c.graph, n.info, "pred", mPred), n.info), n)

# Remember to fix the procs below this one when you make changes!
proc makeRangeWithStaticExpr*(c: PContext, n: PNode): PType =
Expand Down
5 changes: 4 additions & 1 deletion tests/proc/tstaticsignature.nim
Original file line number Diff line number Diff line change
Expand Up @@ -252,4 +252,7 @@ block:
proc foo[I: static int](x: array[I, int]) = discard
foo([1, 2, 3, 4])
proc bar[I: static int](x: array[I * 2, int]) = discard
foo([1, 2, 3, 4])
bar([1, 2, 3, 4])
proc double(x: int): int = x * 2
proc baz[I: static int](x: array[double(I), int]) = discard
doAssert not compiles(baz([1, 2, 3, 4]))

0 comments on commit 686584d

Please sign in to comment.