fix crash calling get_type() on implicitly defined functions