NonCopyableAnalyzer
NonCopyableAnalyzer copied to clipboard
An analyzer for Non-Copyable structs.
 It seems readonly property value not supported. Or it's always copied when using property?
Analysis of ``` public class Test { public void M(object o) { var s = o switch { int _ => "int", _ => "?", }; } } ``` results...
https://github.com/dotnet/roslyn-analyzers/blob/master/src/Roslyn.Diagnostics.Analyzers/Core/DoNotCopyValue.cs Implemented in Roslyn.Diagnostics.Analyzers (an analyzer very specific to the .NET Compiler Platform ("Roslyn") project) and recently enabled in Roslyn repository.
https://github.com/ufcpp/MixinGenerator/blob/master/MixinGenerator/MixinGenerator.Mixins/Annotations/NonCopyableAttribute.cs Seems like not working. Probably because the attribute is internal.
```cs interface INonCopyable { } interface IMovable : INonCopyable { // void OnMoved(); ? } static class MoveExtensions { public static T Move(ref this T x) where T : struct,...
Are there needs for operators? https://github.com/ufcpp/NonCopyableAnalyzer/blob/master/src/NonCopyable/NonCopyable/NonCopyableAnalyzer.cs#L136
```cs interface IDestructible : IMovable, IDisposable { } ``` - destructible must dispose