Skip to content

Null params in matcher#83

Closed
BrennanConroy wants to merge 1 commit intodevfrom
brecon/null_param_middle
Closed

Null params in matcher#83
BrennanConroy wants to merge 1 commit intodevfrom
brecon/null_param_middle

Conversation

@BrennanConroy
Copy link
Member

@BrennanConroy
Copy link
Member Author

Ping @Tratcher

@Tratcher
Copy link
Member

Write a test here or in HttpAbstractions.

@davidfowl
Copy link
Member

Write a test here.

@BrennanConroy
Copy link
Member Author

Added a test

@Tratcher
Copy link
Member

:shipit:

@BrennanConroy BrennanConroy force-pushed the brecon/null_param_middle branch from eb66f60 to 9eac23c Compare January 14, 2016 18:50
@davidfowl
Copy link
Member

This code is used by many other places. Is this behavior the right thing in all cases (I think not). Can you make a list of the callers and see if there are unintended side effects?

@BrennanConroy
Copy link
Member Author

Most uses of the ActivatorUtilities function is using the overload that doesn't take a param [] of args so they are unaffected by this change.

SignalR-Server uses it a couple times mostly in tests, Mvc uses it once and passes a string
So nothing looks like it will break

Also, DependencyInjection has it's own implementation of this class (looks like just copy pasta from some time ago)

@BrennanConroy
Copy link
Member Author

Ping @davidfowl

@davidfowl
Copy link
Member

we shouldn't allow nulls by default. It should be indicated with a default value like:

public class Foo
{
   public Foo(Something x = null, SomethingNotNull y)
   {
   }
}

/cc @pranavkm Don't we support something like this?

@pranavkm
Copy link

Yes, default values should work. However @davidfowl, your example wouldn't actually compile. SomethingNotNull y would also require a default parameter.

@Eilon
Copy link

Eilon commented Jan 27, 2016

Any update on this PR?

I'm not entirely sure I like this behavior. The null support just seems wrong.

@BrennanConroy BrennanConroy deleted the brecon/null_param_middle branch January 29, 2016 19:32
natemcmaster pushed a commit that referenced this pull request Oct 24, 2018
natemcmaster pushed a commit that referenced this pull request Nov 16, 2018
Fix #68 - use trace for header logging
@ghost ghost locked as resolved and limited conversation to collaborators May 30, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants