Substitutions fixed for projections

This commit is contained in:
Andrey Breslav
2011-10-13 17:48:28 +04:00
parent 36453d5e2a
commit 8816bb4a47
2 changed files with 4 additions and 2 deletions
@@ -151,7 +151,7 @@ public class FunctionDescriptorImpl extends DeclarationDescriptorImpl implements
ReceiverDescriptor substitutedExpectedThis = NO_RECEIVER;
if (expectedThisObject.exists()) {
JetType substitutedType = substitutor.substitute(expectedThisObject.getType(), Variance.IN_VARIANCE);
JetType substitutedType = substitutor.substitute(expectedThisObject.getType(), Variance.INVARIANT);
if (substitutedType == null) {
return null;
}
+3 -1
View File
@@ -1,3 +1,5 @@
fun Int.foo() : Boolean = true
fun foo() : Int {
val s = ""
val x = 1
@@ -17,7 +19,7 @@ fun foo() : Int {
else => 1
}
return when (<warning>x</warning>?:null) {
<error>.</error>equals(1) => 1
<error>.</error>foo() => 1
?.equals(1).equals(2) => 1
}
}