class_body
{ "{"
field_declaration
modifiers
private "private"
final "final"
type_identifier "AbstractCompiler"
variable_declarator
identifier "compiler"
; ";"
field_declaration
modifiers
private "private"
final "final"
type_identifier "JSTypeRegistry"
variable_declarator
identifier "typeRegistry"
; ";"
field_declaration
modifiers
private "private"
final "final"
type_identifier "JSType"
variable_declarator
identifier "allValueTypes"
; ";"
field_declaration
modifiers
private "private"
boolean_type "boolean"
variable_declarator
identifier "shouldReport"
= "="
true "true"
; ";"
field_declaration
modifiers
private "private"
final "final"
type_identifier "JSType"
variable_declarator
identifier "nullOrUndefined"
; ";"
line_comment "// TODO(nicksantos): Provide accessors to better filter the "...
line_comment "// mismatches. For example, if we pass (Cake|null) where onl"...
line_comment "// allowed, that doesn't mean we should invalidate all Cakes"...
field_declaration (+21 nodes collapsed)
line_comment "// User warnings"
field_declaration (+28 nodes collapsed)
field_declaration (+39 nodes collapsed)
field_declaration (+25 nodes collapsed)
field_declaration (+25 nodes collapsed)
field_declaration (+31 nodes collapsed)
field_declaration (+45 nodes collapsed)
field_declaration (+25 nodes collapsed)
field_declaration
modifiers
static "static"
final "final"
type_identifier "DiagnosticType"
variable_declarator
identifier "HIDDEN_INTERFACE_PROPERTY_MISMATCH"
= "="
method_invocation
identifier "DiagnosticType"
. "."
identifier "warning"
argument_list
( "("
string_literal
" "\""
string_fragment "JSC_HIDDEN_INTERFACE_PROPERTY_MISMATCH"
" "\""
, ","
binary_expression
binary_expression
binary_expression
string_literal
" "\""
string_fragment "mismatch of the {0} property type and the type "
" "\""
+ "+"
string_literal
" "\""
string_fragment "of the property it overrides from interface {1}"
escape_sequence "\\n"
" "\""
+ "+"
string_literal
" "\""
string_fragment "original: {2}"
escape_sequence "\\n"
" "\""
+ "+"
string_literal
" "\""
string_fragment "override: {3}"
" "\""
) ")"
; ";"
field_declaration
modifiers
static "static"
final "final"
type_identifier "DiagnosticGroup"
variable_declarator
identifier "ALL_DIAGNOSTICS"
= "="
object_creation_expression
new "new"
type_identifier "DiagnosticGroup"
argument_list
( "("
identifier "INVALID_CAST"
, ","
identifier "TYPE_MISMATCH_WARNING"
, ","
identifier "MISSING_EXTENDS_TAG_WARNING"
, ","
identifier "DUP_VAR_DECLARATION"
, ","
identifier "HIDDEN_PROPERTY_MISMATCH"
, ","
identifier "INTERFACE_METHOD_NOT_IMPLEMENTED"
, ","
identifier "HIDDEN_INTERFACE_PROPERTY_MISMATCH"
) ")"
; ";"
constructor_declaration (+77 nodes collapsed)
block_comment "/**\n * Gets a list of type violations.\n *\n * For each "...
method_declaration
generic_type
type_identifier "Iterable"
type_arguments
< "<"
type_identifier "TypeMismatch"
> ">"
identifier "getMismatches"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "mismatches"
; ";"
} "}"
method_declaration (+21 nodes collapsed)
line_comment "// All non-private methods should have the form:"
line_comment "// expectCondition(NodeTraversal t, Node n, ...);"
line_comment "// If there is a mismatch, the {@code expect} method should "...
line_comment "// a warning and attempt to correct the mismatch, when possi"...
block_comment "/**\n * Expect the type to be an object, or a type converti"...
method_declaration (+65 nodes collapsed)
block_comment "/**\n * Expect the type to be an object. Unlike expectObjec"...
method_declaration (+57 nodes collapsed)
block_comment "/**\n * Expect the type to contain an object sometimes. If "...
method_declaration (+81 nodes collapsed)
block_comment "/**\n * Expect the type to be a string, or a type convertib"...
method_declaration (+57 nodes collapsed)
block_comment "/**\n * Expect the type to be a number, or a type convertib"...
method_declaration (+57 nodes collapsed)
block_comment "/**\n * Expect the type to be a valid operand to a bitwise "...
method_declaration (+69 nodes collapsed)
block_comment "/**\n * Expect the type to be a number or string, or a type"...
method_declaration (+68 nodes collapsed)
block_comment "/**\n * Expect the type to be anything but the null or void"...
method_declaration (+156 nodes collapsed)
method_declaration (+78 nodes collapsed)
block_comment "/**\n * Expect that the type of a switch condition matches "...
method_declaration (+104 nodes collapsed)
block_comment "/**\n * Expect that the first type can be addressed with GE"...
method_declaration (+222 nodes collapsed)
block_comment "/**\n * Expect that the first type can be assigned to a sym"...
method_declaration (+140 nodes collapsed)
block_comment "/**\n * Expect that the first type can be assigned to a sym"...
method_declaration (+102 nodes collapsed)
method_declaration (+61 nodes collapsed)
block_comment "/**\n * Expect that the type of an argument matches the typ"...
method_declaration (+100 nodes collapsed)
block_comment "/**\n * Expect that the first type can override a property "...
method_declaration (+114 nodes collapsed)
block_comment "/**\n * Expect that the first type is the direct superclass"...
method_declaration (+198 nodes collapsed)
block_comment "/**\n * Expect that the first type can be cast to the secon"...
method_declaration (+132 nodes collapsed)
block_comment "/**\n * Expect that the given variable has not been declare"...
method_declaration (+436 nodes collapsed)
block_comment "/**\n * Expect that all properties on interfaces that this "...
method_declaration (+107 nodes collapsed)
block_comment "/**\n * Expect that the peroperty in an interface that this"...
method_declaration
modifiers
private "private"
void_type "void"
identifier "expectInterfaceProperty"
formal_parameters (+22 nodes collapsed)
block
{ "{"
if_statement
if "if"
parenthesized_expression
( "("
unary_expression
! "!"
method_invocation
identifier "instance"
. "."
identifier "hasProperty"
argument_list
( "("
identifier "prop"
) ")"
) ")"
block
{ "{"
line_comment "// Not implemented"
local_variable_declaration (+21 nodes collapsed)
expression_statement
assignment_expression
identifier "sourceName"
= "="
ternary_expression
binary_expression
identifier "sourceName"
== "=="
null_literal "null"
? "?"
string_literal
" "\""
" "\""
: ":"
identifier "sourceName"
; ";"
if_statement (+48 nodes collapsed)
expression_statement
method_invocation
identifier "registerMismatch"
argument_list
( "("
identifier "instance"
, ","
identifier "implementedInterface"
) ")"
; ";"
} "}"
else "else"
block
{ "{"
local_variable_declaration
type_identifier "JSType"
variable_declarator
identifier "found"
= "="
method_invocation
identifier "instance"
. "."
identifier "getPropertyType"
argument_list
( "("
identifier "prop"
) ")"
; ";"
local_variable_declaration
type_identifier "JSType"
variable_declarator
identifier "required"
= "="
method_invocation
method_invocation
identifier "implementedInterface"
. "."
identifier "getImplicitPrototype"
argument_list
( "("
) ")"
. "."
identifier "getPropertyType"
argument_list
( "("
identifier "prop"
) ")"
; ";"
expression_statement
assignment_expression
identifier "found"
= "="
method_invocation
identifier "found"
. "."
identifier "restrictByNotNullOrUndefined"
argument_list
( "("
) ")"
; ";"
expression_statement
assignment_expression
identifier "required"
= "="
method_invocation
identifier "required"
. "."
identifier "restrictByNotNullOrUndefined"
argument_list
( "("
) ")"
; ";"
if_statement
if "if"
parenthesized_expression
( "("
unary_expression
! "!"
method_invocation
identifier "found"
. "."
identifier "canAssignTo"
argument_list
( "("
identifier "required"
) ")"
) ")"
block
{ "{"
line_comment "// Implemented, but not correctly typed"
if_statement
if "if"
parenthesized_expression
( "("
identifier "shouldReport"
) ")"
block
{ "{"
local_variable_declaration
type_identifier "FunctionType"
variable_declarator
identifier "constructor"
= "="
method_invocation
method_invocation
identifier "implementedInterface"
. "."
identifier "toObjectType"
argument_list
( "("
) ")"
. "."
identifier "getConstructor"
argument_list
( "("
) ")"
; ";"
expression_statement
method_invocation
identifier "compiler"
. "."
identifier "report"
argument_list
( "("
method_invocation
identifier "t"
. "."
identifier "makeError"
argument_list
( "("
identifier "n"
, ","
identifier "HIDDEN_INTERFACE_PROPERTY_MISMATCH"
, ","
identifier "prop"
, ","
method_invocation
method_invocation
identifier "constructor"
. "."
identifier "getTopMostDefiningType"
argument_list
( "("
identifier "prop"
) ")"
. "."
identifier "toString"
argument_list
( "("
) ")"
, ","
method_invocation
identifier "required"
. "."
identifier "toString"
argument_list
( "("
) ")"
, ","
method_invocation
identifier "found"
. "."
identifier "toString"
argument_list
( "("
) ")"
) ")"
) ")"
; ";"
} "}"
expression_statement
method_invocation
identifier "registerMismatch"
argument_list
( "("
identifier "found"
, ","
identifier "required"
) ")"
; ";"
} "}"
} "}"
} "}"
block_comment "/**\n * Report a type mismatch\n */"
method_declaration (+52 nodes collapsed)
method_declaration (+51 nodes collapsed)
method_declaration (+81 nodes collapsed)
method_declaration (+265 nodes collapsed)
method_declaration (+58 nodes collapsed)
block_comment "/**\n * Formats a found/required error message.\n */"
method_declaration (+39 nodes collapsed)
block_comment "/**\n * Given a node, get a human-readable name for the typ"...
method_declaration (+363 nodes collapsed)
block_comment "/**\n * This method gets the JSType from the Node argument "...
method_declaration (+60 nodes collapsed)
method_declaration (+25 nodes collapsed)
block_comment "/**\n * Signals that the first type and the second type hav"...
class_declaration (+238 nodes collapsed)
} "}"