Merge branch 'master' of github.com:JetBrains/kotlin
This commit is contained in:
@@ -64,6 +64,7 @@ public class NamespaceType implements JetType {
|
||||
|
||||
@Override
|
||||
public boolean isNullable() {
|
||||
throwException();
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -556,7 +556,7 @@ public class BasicExpressionTypingVisitor extends ExpressionTypingVisitor {
|
||||
JetType selectorReturnType = selectorReturnTypeInfo.getType();
|
||||
|
||||
//TODO move further
|
||||
if (expression.getOperationSign() == JetTokens.SAFE_ACCESS) {
|
||||
if (!(receiverType instanceof NamespaceType) && expression.getOperationSign() == JetTokens.SAFE_ACCESS) {
|
||||
if (selectorReturnType != null && !selectorReturnType.isNullable() && !JetStandardClasses.isUnit(selectorReturnType)) {
|
||||
if (receiverType.isNullable()) {
|
||||
selectorReturnType = TypeUtils.makeNullable(selectorReturnType);
|
||||
|
||||
@@ -3,8 +3,14 @@ public class Test {
|
||||
public static final String FOO = "test";
|
||||
}
|
||||
|
||||
// FILE: anotherTest.kt
|
||||
package foo
|
||||
|
||||
val s: String = "test"
|
||||
|
||||
// FILE: test.kt
|
||||
fun ff() {
|
||||
val a = Test?.FOO
|
||||
System?.out.println(a)
|
||||
val b = foo?.s
|
||||
System?.out.println(a + b)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user