modular-framework
modular-framework copied to clipboard
Contracts type narrowing
Scope
Types narrowing for IContract
related registration and Contract<T>
#Justification
IContractRegistry
Current constraints allow for any class to act as a type parameter for .Register<T>()
method. As this would not work I want to improve the developer experience by allowing the compiler to indicate that a given invocation is not supported
Contract<T>
Semantically contracts are intended to validate messages exchanged between modules. Narrowing down the type constraint helps to enforce those sematics.