Perhaps explicitly setting the types might do it?
const x: number[]= [1,2]
const y: number | undefined = x[666]
const z: number = y + 3
EDIT: Just tried, still works