program
comment "// @target: es2015"
comment "// @strict: false"
comment "// Illegal attempts to define optional methods"
variable_declaration (+22 nodes collapsed)
interface_declaration
interface "interface"
type_identifier "I"
interface_body
{ "{"
method_signature
property_identifier "x"
formal_parameters
( "("
) ")"
ERROR
? "?"
type_annotation
: ":"
predefined_type
number "number"
; ";"
comment "// error"
} "}"
class_declaration
class "class"
type_identifier "C"
class_body
{ "{"
method_signature
property_identifier "x"
formal_parameters
( "("
) ")"
ERROR
? "?"
type_annotation
: ":"
predefined_type
number "number"
; ";"
comment "// error"
} "}"
interface_declaration (+23 nodes collapsed)
class_declaration (+23 nodes collapsed)
variable_declaration
var "var"
variable_declarator
identifier "b"
= "="
object
{ "{"
ERROR
property_identifier "x"
formal_parameters
( "("
) ")"
ERROR
? "?"
type_annotation
: ":"
literal_type
number "1"
comment "// error"
} "}"