Skip to content

Commit

Permalink
fixes #24658; cpp compilation failure on Nim 2.2.x (#24663)
Browse files Browse the repository at this point in the history
fixes #24658

(cherry picked from commit 7695d51)
  • Loading branch information
ringabout authored and narimiran committed Feb 4, 2025
1 parent d594e70 commit 27b54fd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion compiler/semstmts.nim
Original file line number Diff line number Diff line change
Expand Up @@ -2351,7 +2351,7 @@ proc semCppMember(c: PContext; s: PSym; n: PNode) =
isInitializer = false
break
var j = 0
while p[j].sym.kind == skParam:
while p[j].kind == nkSym and p[j].sym.kind == skParam:
initializerCall.add val
inc j
if isInitializer:
Expand Down
8 changes: 7 additions & 1 deletion tests/cpp/tconstructor.nim
Original file line number Diff line number Diff line change
Expand Up @@ -128,4 +128,10 @@ block:
var b = makeBoo()
var b2 = makeBoo2()

main()
main()

block: # bug #24658
type
A {.importcpp: "A".} = object

proc a(something: ptr cint = nil): A {.cdecl, constructor, importcpp: "A(@)".}

0 comments on commit 27b54fd

Please sign in to comment.