var a = "123" a["2"] // expect runtime error: Subscript must be a number or a range.