Skip to content
Discussion options

You must be logged in to vote

Yes, compile time error for something that might not actually be reachable at runtime. E.g.

public object Activate<T>()
    => CanUseDefaultConstructor<T>() ? Activator.CreateInstance<T>() : CustomFactory<T>();

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@MichalStrehovsky
Comment options

Answer selected by Aziz-Dhiab
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants