Fixed UnsupportedOperationException when a namespace is used in place of an expression.

This commit is contained in:
Jack Zhou
2013-01-19 11:55:47 -08:00
committed by Alexander Udalov
parent 54e5b6d476
commit 2f47e30a1a
2 changed files with 19 additions and 1 deletions
@@ -841,6 +841,9 @@ public class BasicExpressionTypingVisitor extends ExpressionTypingVisitor {
JetType type = getVariableType(nameExpression, receiver, callOperationNode, context.replaceBindingTrace(traceForVariable), result);
if (result[0]) {
traceForVariable.commit();
if (type instanceof NamespaceType && !context.namespacesAllowed) {
type = null;
}
return JetTypeInfo.create(type, context.dataFlowInfo);
}