In Parshat Vayeishev, the Torah records the lineage of Yehudah. Er, his eldest, is married to Tamar and then dies without offspring. The same occurs with Onan. Yehudah then has children with Tamar (whom he had thought was a prostitute). As some of the commentaries discuss Yibbum in connection to Onan's marriage and perhaps even Yehudah's act, shouldn't Er be Peretz's father, rather than Yehudah?
The verse following the mitzvah of Yibbum seems to imply that the son of the union will be associated with the deceased brother:
והיה הבכור אשר תלד יקום על שם אחיו המת ולא ימחה שמו מישראל
And the first child that is born shall rise up on the name of the deceased brother, and his name shall not be erased from Israel