Issue #3108006 by mondrake, ravi.shankar, longwave: Replace assertInternalType() calls with dedicated methods (cherry picked from commit 221b7aed)