FakeItEasy: Stop throwing first chance exceptions when CreateInstance is called on generic extension point types

Very much like #494, only with open generic types. When we try to instantiate argument formatters, fake configurators, and dummy factories, we may try to instantiate an open generic type, causing a first chance exception.

For an example, see Configure_should_be_null_guarded. We try to instantiate TestableConfigurator<T>.

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Comments: 17 (17 by maintainers)

Most upvoted comments

bothering people who break on first chance exceptions

Then they shouldn’t break on first chance exceptions. As I said above, there are many libraries out there which raise first chance exceptions during regular execution.

slowing things down

Yes, that’s a valid reason to change this behaviour.

On that basis, I’m changing this to an enhancement.

I suppose it depends on what we think a “bug” is.

The symptom this issue was intended to correct is unintended behaviour, which I’d argue is undesirable.

Any exception that’s thrown will cause the runtime to fire up some exception-handling mechanisms which could have a number of unwanted effects, such as bothering people who break on first chance exceptions, or just slowing things down.

If we want to say that removing the unintended undesirable behaviour that may bother the user is closer to a performance improvement (and thus enhancement) than a bug, I’m happy.