Code view:

A painting is a person's account of this edit as text, recorded independently of the node mapping - a rendering often has several equally defensible answers where the mapping has one. Deletions and insertions carry no position on the opposite side in a painting, so that panel draws no caret for them.

Before

1// Each element expression in a non-empty array literal is processed as follows:
2// - If the array literal contains no spread elements, and if the array literal is contextually typed (section 4.19)
3// by a type T and T has a property with the numeric name N, where N is the index of the element expression in the array literal,
4// the element expression is contextually typed by the type of that property.
5
6// The resulting type an array literal expression is determined as follows:
7// - If the array literal contains no spread elements and is contextually typed by a tuple-like type,
…lines 8–35 unchanged (28 lines)

After

1// @target: es2015
2// Each element expression in a non-empty array literal is processed as follows:
3// - If the array literal contains no spread elements, and if the array literal is contextually typed (section 4.19)
4// by a type T and T has a property with the numeric name N, where N is the index of the element expression in the array literal,
5// the element expression is contextually typed by the type of that property.
6
7// The resulting type an array literal expression is determined as follows:
8// - If the array literal contains no spread elements and is contextually typed by a tuple-like type,
…lines 9–36 unchanged (28 lines)

Before

program
comment "// Each element expression in a non-empty array literal is p"...
comment "// - If the array literal contains no spread elements, an"...
comment "// by a type T and T has a property with the numeric na"...
comment "// the element expression is contextually typed by the "...
comment "// The resulting type an array literal expression is determi"...
comment "// - If the array literal contains no spread elements an"...
comment "// the resulting type is a tuple type constructed from"...
variable_declaration (+22 nodes collapsed)
comment "// Error"
variable_declaration (+30 nodes collapsed)
comment "// Error"
comment "// The resulting type an array literal expression is determi"...
comment "// - If the array literal contains no spread elements an"...
comment "// the resulting type is a tuple type constructed from"...
variable_declaration (+34 nodes collapsed)
comment "// The resulting type an array literal expression is determi"...
comment "// - the resulting type is an array type with an elemen"...
comment "// non - spread element expressions and the numeric i"...
variable_declaration (+23 nodes collapsed)
variable_declaration
var "var"
variable_declarator
identifier "temp1"
= "="
array
[ "["
number "1"
, ","
number "2"
, ","
number "3"
] "]"
; ";"
variable_declaration (+46 nodes collapsed)
interface_declaration (+40 nodes collapsed)
interface_declaration
interface "interface"
type_identifier "myArray"
extends_type_clause
extends "extends"
generic_type
type_identifier "Array"
type_arguments
< "<"
type_identifier "Number"
> ">"
interface_body
{ "{"
} "}"
interface_declaration
interface "interface"
type_identifier "myArray2"
extends_type_clause
extends "extends"
generic_type
type_identifier "Array"
type_arguments
< "<"
union_type
type_identifier "Number"
| "|"
type_identifier "String"
> ">"
interface_body
{ "{"
} "}"
variable_declaration
var "var"
variable_declarator
identifier "c0"
type_annotation
: ":"
type_identifier "tup"
= "="
array
[ "["
spread_element
... "..."
identifier "temp2"
] "]"
; ";"
comment "// Error"
variable_declaration (+25 nodes collapsed)
comment "// Error cannot assign number[] to [number, number, number]"
variable_declaration
var "var"
variable_declarator
identifier "c2"
type_annotation
: ":"
type_identifier "myArray"
= "="
array
[ "["
spread_element
... "..."
identifier "temp1"
, ","
spread_element
... "..."
identifier "temp"
] "]"
; ";"
comment "// Error cannot assign (number|string)[] to number[]"

After

program
comment "// @target: es2015"
comment "// Each element expression in a non-empty array literal is p"...
comment "// - If the array literal contains no spread elements, an"...
comment "// by a type T and T has a property with the numeric na"...
comment "// the element expression is contextually typed by the "...
comment "// The resulting type an array literal expression is determi"...
comment "// - If the array literal contains no spread elements an"...
comment "// the resulting type is a tuple type constructed from"...
variable_declaration (+22 nodes collapsed)
comment "// Error"
variable_declaration (+30 nodes collapsed)
comment "// Error"
comment "// The resulting type an array literal expression is determi"...
comment "// - If the array literal contains no spread elements an"...
comment "// the resulting type is a tuple type constructed from"...
variable_declaration (+34 nodes collapsed)
comment "// The resulting type an array literal expression is determi"...
comment "// - the resulting type is an array type with an elemen"...
comment "// non - spread element expressions and the numeric i"...
variable_declaration (+23 nodes collapsed)
variable_declaration
var "var"
variable_declarator
identifier "temp1"
= "="
array
[ "["
number "1"
, ","
number "2"
, ","
number "3"
] "]"
; ";"
variable_declaration (+46 nodes collapsed)
interface_declaration (+40 nodes collapsed)
interface_declaration
interface "interface"
type_identifier "myArray"
extends_type_clause
extends "extends"
generic_type
type_identifier "Array"
type_arguments
< "<"
type_identifier "Number"
> ">"
interface_body
{ "{"
} "}"
interface_declaration
interface "interface"
type_identifier "myArray2"
extends_type_clause
extends "extends"
generic_type
type_identifier "Array"
type_arguments
< "<"
union_type
type_identifier "Number"
| "|"
type_identifier "String"
> ">"
interface_body
{ "{"
} "}"
variable_declaration
var "var"
variable_declarator
identifier "c0"
type_annotation
: ":"
type_identifier "tup"
= "="
array
[ "["
spread_element
... "..."
identifier "temp2"
] "]"
; ";"
comment "// Error"
variable_declaration (+25 nodes collapsed)
comment "// Error cannot assign number[] to [number, number, number]"
variable_declaration
var "var"
variable_declarator
identifier "c2"
type_annotation
: ":"
type_identifier "myArray"
= "="
array
[ "["
spread_element
... "..."
identifier "temp1"
, ","
spread_element
... "..."
identifier "temp"
] "]"
; ";"
comment "// Error cannot assign (number|string)[] to number[]"