-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
[X] avoid AmbiguousMatchException #15873
Conversation
throw new XamlParseException($"Multiple properties with name '{property.DeclaringType}.{property.PropertyName}' found.", lineInfo, innerException: e); | ||
} | ||
}; | ||
minforetriever = () => property.DeclaringType.GetRuntimeProperties().FirstOrDefault(pi => pi.Name == property.PropertyName); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In case anyone else is also curious, initially I was a bit unsure if using the GRP method would fix the issue of retrieving the correct property when there are multiple present. But after talking to @StephaneDelcroix offline and looking at some docs, GRP is built on top of GetProperties, and starting from .NET 7, the order in which the properties are returned is "deterministic based upon the metadata ordering in the assembly" (docs). So, using FirstOrDefault in conjunction with GRP works in our favor to get the relevant property we are seeking.
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
/rebase |
with XamlC disabled, setting an overriden property throws a AmbiguousMatchException. This fixes the mismatch between the 2 inflaters. - fixes #13962
fa6fac4
to
59e6a4d
Compare
with XamlC disabled, setting an overriden property throws a AmbiguousMatchException. This fixes the mismatch between the 2 inflaters. - fixes #13962
Description of Change
with XamlC disabled, setting an overriden property throws a AmbiguousMatchException. This fixes the mismatch between the 2 inflaters.
Issues Fixed