Fix extension receiver coercion for inline classes

#KT-27031
This commit is contained in:
Dmitry Petrov
2018-09-21 17:13:00 +03:00
parent 20d7210239
commit 2e6d53a43f
11 changed files with 176 additions and 1 deletions
@@ -721,7 +721,7 @@ public abstract class StackValue {
) {
// Coerce 'this' for the case when it is smart cast.
// Do not coerce for other cases due to the 'protected' access issues (JVMS 7, 4.9.2 Structural Constraints).
boolean coerceType = descriptor.getKind() == ClassKind.INTERFACE || (castReceiver && !isSuper);
boolean coerceType = descriptor.getKind() == ClassKind.INTERFACE || descriptor.isInline() || (castReceiver && !isSuper);
return new ThisOuter(codegen, descriptor, isSuper, coerceType);
}