ID:2939248
 
Applies to:DM Language
Status: Open

Issue hasn't been assigned a status value.
It'd be nice if we could do inline typecasting, mostly for cases where a macro acts like a proc - procs can have return types, but perhaps the macro has a typepath passed to it, and whatever it does results in said type.

For example, take this:

/// A wrapper for _AddComponent that allows us to pretend we're using normal named arguments
#define AddComponent(typepath, arguments...) _AddComponent(list(typepath, ##arguments))


It'd be useful if you could do something like this:

/// A wrapper for _AddComponent that allows us to pretend we're using normal named arguments
#define AddComponent(typepath, arguments...) (_AddComponent(list(typepath, ##arguments)) as typepath)


So, when using the macro, you can do stuff like this:
thingy.AddComponent(/datum/component/whatever).component_proc()
, the same way you could with a proc with a return type.