This fix should also prevent a class of bugs (which had previously been addressed in whack-a-mole style). Now instead of checking what the return type isn't (an infinite list of unknowns) we check what it is (a finite list of knowns)
Closing this PR. We amended the single commit's commit message, resulting in replacement commit 24e6396d9, and merged that into master in merge commit 0ea0c7aea3b.
This fix should also prevent a class of bugs (which had previously been addressed in whack-a-mole style). Now instead of checking what the return type isn't (an infinite list of unknowns) we check what it is (a finite list of knowns)