getType
Get the type associated with the node.
This method was originally intended to get the type of a value: any value has a type.
For example:
int foo(int a) {
return a; // when getType is invoked on "a" it returns the type "int"
}
Content copied to clipboard
Now, users started using also of names of types itself, which do not have a type.
For example:
class A {
int foo(int a) {
return A.someStaticField; // when getType is invoked on "A", which represents a class, it returns
// the type "A" itself while it used to throw UnsolvedSymbolException
}
Content copied to clipboard
To accommodate this usage and avoid confusion this method return the type itself when used on the name of type.