summaryrefslogtreecommitdiffstats
path: root/searchlib
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@oath.com>2018-02-05 17:06:05 +0100
committerJon Bratseth <bratseth@oath.com>2018-02-05 17:06:05 +0100
commit53041a25e69fbda934f8e7645ecf8220edfbea78 (patch)
treeefd801051e0e552c2733f2eb01b2e4ccda518a7e /searchlib
parent3632387ab3bf56688d54c0714bcefe6f0f6d999f (diff)
Typecheck all ranking expressions
Diffstat (limited to 'searchlib')
-rwxr-xr-xsearchlib/src/main/java/com/yahoo/searchlib/rankingexpression/rule/ReferenceNode.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/searchlib/src/main/java/com/yahoo/searchlib/rankingexpression/rule/ReferenceNode.java b/searchlib/src/main/java/com/yahoo/searchlib/rankingexpression/rule/ReferenceNode.java
index 05a6773c5cb..56914143e25 100755
--- a/searchlib/src/main/java/com/yahoo/searchlib/rankingexpression/rule/ReferenceNode.java
+++ b/searchlib/src/main/java/com/yahoo/searchlib/rankingexpression/rule/ReferenceNode.java
@@ -108,7 +108,10 @@ public final class ReferenceNode extends CompositeNode {
@Override
public TensorType type(TypeContext context) {
// Don't support outputs of different type, for simplicity
- return context.getType(toString());
+ TensorType type = context.getType(toString());
+ if (type == null)
+ throw new IllegalArgumentException("Could not determine type of feature " + toString());
+ return type;
}
@Override