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
Post a Comment