[FIX] GH-849: Defer type errors when pushing type checks into `if` branches.
Merge pull request #852 from LeoWoerteler/gh-849

[FIX] GH-849: Defer type errors when pushing type checks into `if` branches.