Type inference breaks if class EnumeratorItemType attribute hasn't yet been visited.
Attachment has one way to fix it along with test case that demonstrates bug. If you fix it a different way, test it with the source spread across multiple files, too. Some fixes only fix single file example.
TypeSystemServices.GetEnumeratorItemTypeFromAttribute is where the actual failure happens, since the enumeratoritem attribute doesn't have an entity yet. But I put the fix in ProcessMethodBodies.ensurerelatednodewasvisited.