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
Nim Compiler Version 2.2.0 [Linux: amd64]
Compiled at 2024-10-02
Copyright (c) 2006-2024 by Andreas Rumpf
git hash: 78983f1
active boot switches: -d:release
Current Output
....../nim-2.2.0/lib/system.nim(2955, 19) Error: '=copy' is not available for type <Bar>; requires a copy because it's not the last read of 'y'; try to make y a 'sink' parameter; routine: arrayWith
Expected Output
<no compilation error>
Known Workarounds
Removing the default value for Bar.b will get rid of the error.
Removing the copy-prevention will get rid of the error.
Using =dup will get rid of the error (see comment below)
Not using the object-initialiser will get rid of the error (i.g. not using Foo() and setting fields manually).
Additional Information
I noticed that there is a comment # TODO: fixme it should be `=dup` just at the line where the error is reported. When changing that according line to result[i] = `=dup`(y) the compiler error is gone. Not sure if that has any further impact in other places though...
The text was updated successfully, but these errors were encountered:
Description
Sorry for the bad title, I am not sure how describe this better. However, I have a rather short piece of code that reproduces the code.
The following code will give a compiler error.
Nim Version
Nim Compiler Version 2.2.0 [Linux: amd64]
Compiled at 2024-10-02
Copyright (c) 2006-2024 by Andreas Rumpf
git hash: 78983f1
active boot switches: -d:release
Current Output
Expected Output
Known Workarounds
Bar.b
will get rid of the error.=dup
will get rid of the error (see comment below)Foo()
and setting fields manually).Additional Information
I noticed that there is a comment
# TODO: fixme it should be `=dup`
just at the line where the error is reported. When changing that according line toresult[i] = `=dup`(y)
the compiler error is gone. Not sure if that has any further impact in other places though...The text was updated successfully, but these errors were encountered: