use actual class type for constructor inlining, because the type of a variable can be abstract (closes #3586)