Fixes RT#91966 (deprecated way to call enum warning)

This is a fix for RT#91966: https://rt.cpan.org/Ticket/Display.html?id=91966