Muhammad Bin Ya’qub of Abu ‘Ali Al-Ash’ary of Muhammad Bin ‘Abd-ul-Jabar and of Muhammad Bin Isma’il of Al-Fadhl Bin Schadhan Jami’an, of Sufuan Bin Yahya of Ibn Meskan of Dawud Bin Farqad of Abu ‘Abdallah (see also), who said: “I asked him about a child who has a vagina and a penis, how does he inherit?” So he (a.s.) said: “If it urinated from his penis, it is the inheritance of the male person and if it urinated from his vagina, it is the inheritance of the female person.” [Tadhib-Al-Ahkam, Volume 9, Page 353]
محمد بن يعقوب ، عن أبي علي الاشعري ، عن محمد بن عبد الجبار ، وعن محمد بن إسماعيل ، عن الفضل بن شاذان جميعا ، عن صفوان بن يحيى ، عن ابن مسكان ، عن داود بن فرقد ، عن أبي عبدالله ( عليه السلام ) قال : سئل عن مولود ولد ، له قبل وذكر ، كيف يورث ؟ قال : إن كان يبول من ذكره فله ميراث الذكر ، وإن كان يبول من القبل فله ميراث الانثى
From Imam ‘Ali (s.a), who said: “As for the feminine person, the person in question is the one who does not know: wether male or female? With this, one has to wait. If he is a male, he will have a wet dream and if she is a female, she will menstruate and reveal her breasts, and if not, you speak to the person: “urinate against the wall!” If the urine hits the wall, it is a male, and if it went back like the urine of the camel went back, she is a woman.” [Al-Khisal, page 441]