What are the constraints of Swift's array syntax? -


i'm working through exercises in the swift programming language, , 1 thing noted odd array syntax.

per this answer, array<t.generator.element>() works, yet var common = [t.generator.element]() not. @ same time, var common: [t.generator.element] = [] correct.

what rules around array syntax/initialization? why doesn't second line work?


Comments

Popular posts from this blog

Android : Making Listview full screen -

javascript - Parse JSON from the body of the POST -

javascript - How to Hide Date Menu from Datepicker in yii2 -