Generic function?

Monkeyc has generic classes (e.g. Dictionary) - can I somehow define a custom generic function?

E.g. like folloiwng (not compiling):

(:inline)
static function <T> getValue(value as T?, defaultValue as T) as T {
    return value != null ? value as T : defaultValue;
}

With monkeyc prettier this should allow me to use this function without any overhead and without the need to write this sort of ternary operater replacement manully everywhere...