Merge pull request #82 from udalov/kt2109

KT-2109 Nullability inference fails in extension function
This commit is contained in:
Svetlana Isakova
2012-06-20 04:39:17 -07:00
2 changed files with 21 additions and 1 deletions
@@ -52,7 +52,7 @@ public class DataFlowValueFactory {
@NotNull
public DataFlowValue createDataFlowValue(@NotNull ThisReceiverDescriptor receiver) {
JetType type = receiver.getType();
return new DataFlowValue(receiver.getDeclarationDescriptor(), type, true, getImmanentNullability(type));
return new DataFlowValue(receiver, type, true, getImmanentNullability(type));
}
@NotNull
@@ -0,0 +1,20 @@
//KT-2109 Nullability inference fails in extension function
package kt2109
class A {
fun foo() {}
}
fun A?.bar() {
if (this == null) {
return
}
foo()
}
fun A.baz() {
if (<!SENSELESS_COMPARISON!>this == null<!>) {
return
}
foo()
}