Recently I worked intensively with Cecil for code generation task. And my 
biggest problem was that I cannot compare two TypeReference instances even 
if they represent the same type. There're two problems with this. I had to 
compare their full names or even assembly-qualified names. It's 
inconvenient, leads to less readable code (code generation code is not too 
readable by its nature plus this small issue) and worse performance. 

The problem could be resolved by simple overloading of Object.Equals and 
operators == and != (I'm not sure about operators). This won't resolve 
performance problem. For performance you can use kind of internal registry 
and factory for Type[Reference/Definition] which returns the same instance 
for the same type. In this case no need to override comparison.

It would be interesting to hear what you think about this.

Cheers,
Andriy

-- 
-- 
--
mono-cecil
--- 
You received this message because you are subscribed to the Google Groups 
"mono-cecil" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to