validatePatternBindingEntry() question

At the end of validatePatternBindingEntry(), the code checks type-adjusting attributes – but only if the pattern entry has a type. I tried adding an assert to see when/if a type wouldn't be set, and the validation test suite still passed on my Linux box. When would a type not be set?

For reference:

diff --git i/lib/Sema/TypeCheckDecl.cpp w/lib/Sema/TypeCheckDecl.cpp
@@ -1193,6 +1193,7 @@ static void validatePatternBindingEntry(TypeChecker &tc,
   // If we have any type-adjusting attributes, apply them here.
+  assert(binding->getPattern(entryNumber)->hasType());
   if (binding->getPattern(entryNumber)->hasType())
     if (auto var = binding->getSingleVar())

It could be that at some point in the past, the type might not have been set at this stage, perhaps in some error case that can no longer occur. Feel free to replace the check with an assert and submit a patch.