var/mob/moth/player = new /mob/moth
...this creates a lot of visual noise, and carries the potential of putting the wrong type on either end, causing bugs. Instead, I can do:
var/mob/moth/player = new
...which, while harder to grep, causes a lot less bugs. This is a case of DM using the inferred type of /mob/moth.
On tgstation, we have a proc that essentially wraps new called "allocate". The point is so we can guarantee it gets cleaned up at a certain point. However, we are required to write the whole thing out like this:
var/mob/moth/player = allocate(/mob/moth)
...which creates the same noise as new. It would be nice to be able to receive the inferred type.
The implementation of this should be able to easily support cases where parameters are put in afterwards, as well. For instance:
var/no_type = allocate(/mob/moth, location)
var/mob/moth/player = allocate(location)
...should be trivial to implement.
I do not want to have to check to make sure the first parameter is a path. That would hurt!
Here is a rough, contrived idea just to give an idea of how a DM coder could create this interface trivially: