StubbleOrg / Stubble

Trimmed down {{mustache}} templates in .NET
Other
402 stars 58 forks source link

If a reflected member is declared twice exception will occur #41

Closed glennawatson closed 5 years ago

glennawatson commented 5 years ago

I am using the type reflection based approach to convert ReactiveUI's EventBuilder over to use Stubble, previously it was using Mustache.

What this event builder does is generate code based around events in a class.

The ReflectionHelper.GetMemberFunctionLookup() can't handle this case at the moment due to just directly adding to the dictionary and not checking to see if the key already exists. It's crashing for me on get_DeclaredType().

Adding a ContainsValue() check can eliminate the crash. Not sure if that's quite desired functionality.

Romanx commented 5 years ago

This has now been released in version 1.2 on nuget. Thanks very much for your contribution! 👍