Thanks to visit codestin.com
Credit goes to github.com

Skip to content

False positive on conversion operators, that take arguments by reference #14

New issue

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

Closed
lostmsu opened this issue Mar 18, 2020 · 3 comments
Closed

Comments

@lostmsu
Copy link
Contributor

lostmsu commented Mar 18, 2020

[NonCopyable]
ref struct NewReference
{
  // this should be allowed to be called any time,
  // because it takes input by reference (e.g. `in` is used)
  public static implicit operator BorrowedReference(in NewReference reference)
    => new BorrowedReference(reference.pointer);
}
...
NewReference @new = new NewReference();
BorrowedReference borrowed = @new; // "error NoCopy06: 🚫 conversion"
@lostmsu
Copy link
Contributor Author

lostmsu commented Mar 18, 2020

BTW, cool project! Started using it in Python.NET. Rust-style lifetime tracking FTW!

Meta BTW: cool, GitHub shows us as a user in "UsedBy".

@ufcpp
Copy link
Owner

ufcpp commented Mar 18, 2020

Thank you so much for your great feedback! I'm honored to hear that😊 However, I'm too busy to re-build this project now. It's helpful for me if you send me pull request and I will accept it! Thanks again your feedback!!

lostmsu added a commit to losttech/pythonnet that referenced this issue Mar 18, 2020
@ufcpp
Copy link
Owner

ufcpp commented Mar 19, 2020

lostmsu added a commit to lostmsu/NonCopyableAnalyzer that referenced this issue Apr 23, 2020
ufcpp added a commit that referenced this issue Apr 24, 2020
Fixed false positive on conversion operators with in argument #14
@ufcpp ufcpp closed this as completed Apr 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants