Fixed #4695: Infinite recursion inside isRecordTypeWithoutSideEffects()