#367 DynamicJava Interpreter Should Return Type of Result

open
nobody
5
2010-02-24
2010-02-24
Anonymous
No

The DynamicJava interpreter should be modified to not just return the result of an evaluation, but also the type.

This would simplify and extend DrJava's ability to display the type of Watch expressions in the debugger.
See bug report 2957035: Unable to view watch variables
http://sourceforge.net/tracker/index.php?func=detail&aid=2957035&group_id=44253&atid=438935

We do not have good type information, though, because there is no way to distinguish whether the interpreter returned a primitive or a boxed type right now. Also, handling both local variables and fields is messy right now, so local variables currently do not display type information.

Both of these problems can be addressed by also returning the type of an interpretation result. Even if we return an Integer(1), we can return int.class as type and therefore distinguish primitive and boxed types. We also do not have to treat fields and local variables separately; we can just evaluate both and display the result type.

Discussion

  • Mathias Ricken
    Mathias Ricken
    2010-02-24

    The problem about local variables was addressed. It still isn't possible to distinguish boxed and primitive types, though.