We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Depending on what hooks exist for a type top level variables might be moved instead of copied:
type MyType = object a: int proc `=destroy`(typ: MyType) = echo "Destroyed: ", typ.a var t1 = MyType(a: 100) var t2 = t1 # Should be a copy? proc main() = t2 = t1 echo t1 echo t2 main()
2.0.4 and devel
(a: 0) (a: 0) Destroyed: 0 Destroyed: 0
(a: 100) (a: 100) Destroyed: 100 Destroyed: 100
No response
The text was updated successfully, but these errors were encountered:
fixes #23524; global variables cannot be analysed
009bf7f
move
fixes #23524; global variables cannot be analysed when injecting `mov…
cd3cf3a
…e` (#23529) fixes #23524 ```nim proc isAnalysableFieldAccess*(orig: PNode; owner: PSym): bool = ... result = n.kind == nkSym and n.sym.owner == owner and {sfGlobal, sfThread, sfCursor} * n.sym.flags == {} and (n.sym.kind != skParam or isSinkParam(n.sym)) ``` In `isAnalysableFieldAccess`, globals, cursors are already rejected
ringabout
Successfully merging a pull request may close this issue.
Description
Depending on what hooks exist for a type top level variables might be moved instead of copied:
Nim Version
2.0.4 and devel
Current Output
Expected Output
Possible Solution
No response
Additional Information
No response
The text was updated successfully, but these errors were encountered: