Fixed UnsupportedOperationException when a namespace is used in place of an expression.
This commit is contained in:
committed by
Alexander Udalov
parent
54e5b6d476
commit
2f47e30a1a
+3
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,22 @@ class X {}
|
||||
val s = <!EXPRESSION_EXPECTED_NAMESPACE_FOUND!>java<!>
|
||||
val ss = <!NO_CLASS_OBJECT!>System<!>
|
||||
val sss = <!NO_CLASS_OBJECT!>X<!>
|
||||
val x = "${<!NO_CLASS_OBJECT!>System<!>}"
|
||||
val xs = java.<!EXPRESSION_EXPECTED_NAMESPACE_FOUND!>lang<!>
|
||||
val xss = java.lang.<!NO_CLASS_OBJECT!>System<!>
|
||||
val xsss = foo.<!NO_CLASS_OBJECT!>X<!>
|
||||
val xssss = <!EXPRESSION_EXPECTED_NAMESPACE_FOUND!>foo<!>
|
||||
val xssss = <!EXPRESSION_EXPECTED_NAMESPACE_FOUND!>foo<!>
|
||||
val f = { <!NO_CLASS_OBJECT!>System<!> }
|
||||
|
||||
fun main(args : Array<String>) {
|
||||
<!EXPRESSION_EXPECTED_NAMESPACE_FOUND, VARIABLE_EXPECTED!>java<!> = null
|
||||
<!NO_CLASS_OBJECT!>System<!> = null
|
||||
<!NO_CLASS_OBJECT!>System<!>!!
|
||||
java.lang.<!NO_CLASS_OBJECT!>System<!> = null
|
||||
java.lang.<!NO_CLASS_OBJECT!>System<!>!!
|
||||
<!NO_CLASS_OBJECT!>System<!> is Int
|
||||
<!INVISIBLE_MEMBER!>System<!>()
|
||||
(<!NO_CLASS_OBJECT!>System<!>)
|
||||
@foo <!NO_CLASS_OBJECT!>System<!>
|
||||
null in <!NO_CLASS_OBJECT!>System<!>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user