Sweden had, until 1980, a so-called agnatic succession, meaning only men could inherit the throne.
When Prince Carl Philip was born in 1979 he was born as crown prince, only to have the title removed a year later when the new act of succession took effect, thus making his older sister crown princess. The new act of succession means the oldest child, no matter what gender, inherits the crown.
According to the Act of Succession, paragraph 5: “Prince or princess of the royal house may not marry unless the government and the king have given their consent. If a wedding is still to occur, he or she will forfeit the right to the throne for his or herself as well as any offspring. Law (1979:935).”
The Crown of Sweden before restoration work it in the 20th century.