Issue #3108006 by mondrake, longwave, ravi.shankar, alexpott: Replace assertInternalType() calls with dedicated methods