kekekeks / XamlX

General purpose pluggable XAML compiler with no runtime dependencies.
MIT License
305 stars 55 forks source link

Use less aggressive CecilTypeComparisonMode.SignatureOnlyLoose by default #116

Closed maxkatz6 closed 5 months ago

maxkatz6 commented 5 months ago

Regression from https://github.com/kekekeks/XamlX/pull/114

What I didn't pay attention, by default, TypeReferenceEqualityComparer was resolving all compared types. Which makes sense, when you want to be exact about comparison, but in XamlX we don't have these scenarios. Pretty much every type usage in XamlX can be defined in a random assembly, until full type name matches.

This PR changes default mode to SignatureOnlyLoose. Also hides Resolve usage only under Exact mode.

Fixes https://github.com/AvaloniaUI/Avalonia/issues/15436

I was also thinking that we shouldn't really resolve all IXamlType types ahead. Especially for usages like XamlAttribute.Type, where it's enough to only have a TypeReference. But this change would be way too involving, so I will leave it for the future.