`TypeInference` not working
I am getting a class cast exception when trying to use TypeInference on Python code. The instruction causing the exception is as follows:
s PythonInvokeInstruction (id=106)
10 = invokeFunction < PythonLoader, LCodeBody, do()LRoot; > 3,11,2 @5 exception:12
The problem occurs in com.ibm.wala.cast.python.ssa.PythonInvokeInstruction.visit(IVisitor). It tries to cast a TypeInference$TypeOperatorFactory (the type of v below) to a com.ibm.wala.cast.python.ssa.PythonInstructionVisitor:
https://github.com/wala/ML/blob/a8e1d8e54536d382b54c80cdd52f302b0ea06123/com.ibm.wala.cast.python/source/com/ibm/wala/cast/python/ssa/PythonInvokeInstruction.java#L121
My guess is that TypeInference.make() should be returning a different type. I see that there is com.ibm.wala.cast.java.analysis.typeInference.AstJavaTypeInference in WALA but no com.ibm.wala.cast.python.analysis.typeInference.AstPythonTypeInference in wala/ML.
Though, I am unsure what AST has to do with it since it is SSA at this point ...
There is already a language field in TypeInference. Perhaps then if any subclassing is to be done it would be TypeInference that would be the parent.
Looks like the new class would inherit from com.ibm.wala.cast.analysis.typeInference.AstTypeInference.