@@ -2065,7 +2065,11 @@ class MethodCall extends Expr, Call, @methodaccess {
2065
2065
override Stmt getEnclosingStmt ( ) { result = Expr .super .getEnclosingStmt ( ) }
2066
2066
2067
2067
/** Gets a printable representation of this expression. */
2068
- override string toString ( ) { result = this .printAccess ( ) }
2068
+ override string toString ( ) {
2069
+ if exists ( this .getMethod ( ) )
2070
+ then result = this .printAccess ( )
2071
+ else result = "<Call to unknown method>"
2072
+ }
2069
2073
2070
2074
/** Gets a printable representation of this expression. */
2071
2075
string printAccess ( ) { result = this .getMethod ( ) .getName ( ) + "(...)" }
@@ -2128,13 +2132,19 @@ class TypeAccess extends Expr, Annotatable, @typeaccess {
2128
2132
/** Gets the compilation unit in which this type access occurs. */
2129
2133
override CompilationUnit getCompilationUnit ( ) { result = Expr .super .getCompilationUnit ( ) }
2130
2134
2131
- /** Gets a printable representation of this expression. */
2132
- override string toString ( ) {
2135
+ string toNormalString ( ) {
2133
2136
result = this .getQualifier ( ) .toString ( ) + "." + this .getType ( ) .toString ( )
2134
2137
or
2135
2138
not this .hasQualifier ( ) and result = this .getType ( ) .toString ( )
2136
2139
}
2137
2140
2141
+ /** Gets a printable representation of this expression. */
2142
+ override string toString ( ) {
2143
+ if this .getType ( ) instanceof ErrorType
2144
+ then result = "<TypeAccess of ErrorType>"
2145
+ else result = this .toNormalString ( )
2146
+ }
2147
+
2138
2148
override string getAPrimaryQlClass ( ) { result = "TypeAccess" }
2139
2149
}
2140
2150
0 commit comments