ufcpp / NonCopyableAnalyzer

An analyzer for Non-Copyable structs.
MIT License
31 stars 4 forks source link

more precise reason #7

Closed ufcpp closed 6 years ago

ufcpp commented 6 years ago

now:

var origin = new X();
var copy = origin; // NoCopy

origion.ByValExtensionMethod(); // NoCopy

ref readonly var ro = ref origin;
ro.Method(); // NoCopy

Should be changed?

var origin = new X();
var copy = origin; // assingment error

origion.ByValExtensionMethod(); // pass-by-value error

ref readonly var ro = ref origin;
ro.Method(); // readonly defensive copy error
ufcpp commented 6 years ago

done