[Analysis API] Fix exceptions around type parameters being treated as callables

- `toResolvedCallableSymbol`: cast defensively because
  the resolved symbol might not be a callable symbol.
- `toKtCallInfo`: Check that the resolved symbol is actually callable.

^KTIJ-23003 fixed
This commit is contained in:
Marco Pennekamp
2022-11-11 13:49:55 +01:00
committed by teamcity
parent 170c19d293
commit c5e5140c08
11 changed files with 67 additions and 5 deletions
@@ -74,7 +74,7 @@ fun FirExpression.toReference(): FirReference? {
}
fun FirExpression.toResolvedCallableSymbol(): FirCallableSymbol<*>? {
return toResolvedCallableReference()?.resolvedSymbol as FirCallableSymbol<*>?
return toResolvedCallableReference()?.resolvedSymbol as? FirCallableSymbol<*>?
}
fun FirReference.toResolvedCallableSymbol(): FirCallableSymbol<*>? {