Skip to content
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

Compiled renderer does not throw on ambiguous views #81

Closed
janhohenheim opened this issue Nov 29, 2019 · 2 comments
Closed

Compiled renderer does not throw on ambiguous views #81

janhohenheim opened this issue Nov 29, 2019 · 2 comments
Assignees
Labels
Milestone

Comments

@janhohenheim
Copy link

janhohenheim commented Nov 29, 2019

When using the setting SetIgnoreCaseOnKeyLookup(true), the behavior when passing an ambiguous view is inconsistent.
On the template
"{{name}}"
with the view

new { Name = "foo", name = "bar" }

the regular renderer throws an StubbleException, while the compiled one simply uses the first property, resulting in "foo"

Romanx added a commit that referenced this issue Nov 30, 2019
@Romanx
Copy link
Contributor

Romanx commented Nov 30, 2019

Hey there,

Thanks for opening this issue. You're right this is definately an oversight and I get an argument exception on the default renderer since we're not handling this case gracefully.

I've added a new exception type StubbleAmbigousMatchException which will be thrown when this happens, on Compile for the compilation renderer and on Render for the standard renderer.

I'll get this merged shortly into master and after i've looked at your other issue i'll get a release out. Thanks for your clear reproduction cases

@Romanx Romanx self-assigned this Nov 30, 2019
@Romanx Romanx added this to the 1.6 milestone Nov 30, 2019
@Romanx Romanx added the bug label Nov 30, 2019
Romanx added a commit that referenced this issue Dec 1, 2019
* Add exception for ambiguous data match

#81

* Add ambiguous data exception to compilation

#81
@Romanx
Copy link
Contributor

Romanx commented Dec 1, 2019

@jnferner Thanks very much for reporting this. It has been fixed in release 1.6.3 and has now been released on nuget.

Please let us know if you have any other issues.

@Romanx Romanx closed this as completed Dec 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants