Issue #1123: Make checks for generator functions without yield optional