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