You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When constructor with parameters imported from C++ is called, default constructor is called instead.
This happens only when compiled with --exceptions:goto option, doesn't happen with --exceptions:cpp and exceptions:quirky.
Calling constructor with parameter after declaring the variable can workaround this problem as long as it has default constructor.
Following code works correctly.
Description
When constructor with parameters imported from C++ is called, default constructor is called instead.
This happens only when compiled with
--exceptions:goto
option, doesn't happen with--exceptions:cpp
andexceptions:quirky
.Example:
testcpp.nim
Compile it with
nim cpp -r --exceptions:goto testcpp.nim
.Nim Version
Nim Compiler Version 2.1.1 [Linux: amd64]
Compiled at 2023-09-11
Copyright (c) 2006-2023 by Andreas Rumpf
git hash: fbb5ac5
active boot switches: -d:release
Current Output
Expected Output
Possible Solution
No response
Additional Information
Nim generated C++ code compiled with
--exceptions:goto
:Nim generated C++ code compiled with
--exceptions:cpp
:The text was updated successfully, but these errors were encountered: