Skip to content

Activator.CreateInstance returning object? instead of object. #45293

Answered by svick
sjb-sjb asked this question in Q&A
Discussion options

You must be logged in to vote

I don't understand, that question complains that Activator.CreateInstance does return null in some cases (namely, for nullable value types). So I think object? is the correct return type.

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@yaakov-h
Comment options

@gfoidl
Comment options

Answer selected by stephentoub
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants