Automatic resolving a concrete class from abstract type