[Pitch] InlineArray type sugar

Speaking of “#” …what about this?

var x: [3 # Int] = [1, 2, 3]

It even works with the count, element type, or both being inferred:

var x: [# Int] = [1, 2, 3]

var y: [3 #] = [1, 2, 3]

var z: [#] = [1, 2, 3]

The proposal mentions# as an option among the “arbitrary punctuation”, but… it’s the number sign, so it’s not really arbitrary.

9 Likes