It’s edible.
This is nightshade. Solanaceae is an annual herbaceous plant with small white flowers blooming in summer, with 4-10 flowers forming cymes;
Spherical berries that turn black-purple when mature. Both the berries and leaves are edible, but the leaves contain high amounts of alkaloids that must be cooked to detoxify them.
The whole plant can be used as medicine to disperse blood stasis, reduce swelling, clear away heat and detoxify. :
Solanum nigrum is also known as wild pepper, bitter sunflower, seven-grain button, white cauliflower, sky eggplant, sky eggplant, and old crow's eye grass. Annual herb, 30-70 cm tall. Born in wastelands, roadsides, fields, and damp places in front of and behind houses. The stems are erect, multi-branched, and have fine hairs on the young stems. The leaves are alternate, oval, 3-9 cm long, with irregular wavy serrated edges. The total pedicel is born on the side of the branch, with 4-10 small flowers, which are gathered at the top of the stem to form an umbrella shape. _Green, five-lobed. Corolla white.
The whole medicinal plant, collected in summer and autumn. Wash, cut, dry and set aside. Can also be used fresh. Bitter, slightly sweet, flat. It has the effects of clearing away heat, detoxifying, diuresis and reducing swelling. Treat dysentery, hypertension, jaundice, diabetes, leucorrhea, boils, gastric cancer, esophageal cancer, diphtheria, diplopia caused by snake bites, wind and fire toothache, acute tonsillitis, cold and fever, acute nephritis and other diseases. Solanum nigrum is a Chinese herbal medicine often used by traditional Chinese medicine, herbal medicine, and common people.
Reference: People's Daily Online_Solanum nigrum related introduction