Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@

public class ContextItemExpression extends LocationStep {

private int returnType = Type.ITEM;

public ContextItemExpression(final XQueryContext context) {
// TODO: create class AnyItemTest (one private implementation found in saxon)
super(context, Constants.SELF_AXIS, new AnyNodeTest());
Expand All @@ -40,7 +38,7 @@ public ContextItemExpression(final XQueryContext context) {
public void analyze(AnalyzeContextInfo contextInfo) throws XPathException {
contextInfo.addFlag(DOT_TEST);
// set return type to static type to allow for index use in optimization step
returnType = contextInfo.getStaticType();
staticReturnType = contextInfo.getStaticType();

super.analyze(contextInfo);
}
Expand Down Expand Up @@ -69,7 +67,8 @@ public Sequence eval(final Sequence contextSequence, final Item contextItem) thr

@Override
public int returnsType() {
return returnType;
// "." will have the same type as the parent expression
return staticReturnType;
}

@Override
Expand Down
Loading