Skip to content

Commit 5d7e0cb

Browse files
committed
[fix] allow ArrayConstructors in EnclosedExpressions
1 parent 9e2cb46 commit 5d7e0cb

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

exist-core/src/main/java/org/exist/xquery/SequenceConstructor.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,14 +124,15 @@ public String toString() {
124124

125125
/**
126126
* Add another PathExpr to this object's expression list.
127-
* Performs a static check, if return type is a function type.
127+
* Performs a static check, if return type is a function type other than array.
128+
* see #id-content setion 1.e.i and 1.e.ii
128129
*
129130
* @throws XPathException when Path returns a function type
130131
* @param path A path to add to this path
131132
*/
132133
public void addPathIfNotFunction(final PathExpr path) throws XPathException {
133134
int retType = path.returnsType();
134-
if (Type.subTypeOf(retType, Type.FUNCTION_REFERENCE)) {
135+
if (Type.subTypeOf(retType, Type.FUNCTION_REFERENCE) && retType != Type.ARRAY) {
135136
throw new XPathException(path, ErrorCodes.XQTY0105, "Function types are not allowed in element content. Got " + Type.getTypeName(retType));
136137
}
137138
super.addPath(path);

0 commit comments

Comments
 (0)