Use 1.8 has syntax

Fixes #30558.