org.eclipse.xtend.middleend.xtend.internal
Class OldTypeAnalyzer
java.lang.Object
org.eclipse.xtend.middleend.xtend.internal.OldTypeAnalyzer
public final class OldTypeAnalyzer
- extends java.lang.Object
This class is a visitor that serves as a replacement for the "analyze"
methods of the Expression classes. While the "analyze" methods perform
strict static checking, this class does a "best effort": It finds
the best statically predictable type, based on the assumption that
the code is dynamically correct.
An example can illustrate this. Let "x" be a collection with statically
unknown inner type. Then the two approaches yield different results for
"x.myProperty". The analyze methods in the expressions return "null"
because they can not statically ensure the type correctness of the
expression. This class on the other hand returns the type "Collection[Object]".
- Author:
- Arno Haase (http://www.haase-consulting.com), André Arnold
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
OldTypeAnalyzer
public OldTypeAnalyzer()
analyze
public Type analyze(ExecutionContext ctx,
Extension ext,
Type[] paramTypes)
analyze
public Type analyze(ExecutionContext ctx,
Expression expr)