New J2K: fix UninitializedPropertyAccessException when calculating type of anonymous class
#KT-35395 fixed
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
interface Foo {
|
||||
}
|
||||
|
||||
public class Bar {
|
||||
void test() {
|
||||
new Foo() {
|
||||
void foo() {
|
||||
bug(this);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
void bug(Foo foo) {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
// ERROR: 'public' function exposes its 'internal' parameter type Foo
|
||||
internal interface Foo
|
||||
class Bar {
|
||||
fun test() {
|
||||
object : Foo {
|
||||
fun foo() {
|
||||
bug(this)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun bug(foo: Foo?) {}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
public class Foo {
|
||||
|
||||
void fail() {
|
||||
new Test.FrameCallback() {
|
||||
public void doFrame() {
|
||||
new Test().postFrameCallbackDelayed(this);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
class Test {
|
||||
public interface FrameCallback {
|
||||
void doFrame();
|
||||
}
|
||||
|
||||
void postFrameCallbackDelayed(Test.FrameCallback callback) {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
import Test.FrameCallback
|
||||
|
||||
class Foo {
|
||||
fun fail() {
|
||||
object : FrameCallback {
|
||||
override fun doFrame() {
|
||||
Test().postFrameCallbackDelayed(this)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
internal class Test {
|
||||
interface FrameCallback {
|
||||
fun doFrame()
|
||||
}
|
||||
|
||||
fun postFrameCallbackDelayed(callback: FrameCallback?) {}
|
||||
}
|
||||
Reference in New Issue
Block a user