New J2K: do not allow field and method declarations to be internal
For internal members new names are generated, So, references to them from Java will be broken
This commit is contained in:
@@ -14,9 +14,9 @@ class Target {
|
||||
|
||||
var hashMapOfNotImported: Map<ToBeImportedJava, ToBeImportedKotlin> = HashMap()
|
||||
|
||||
internal fun acceptKotlinClass(tbi: ToBeImportedKotlin?) {}
|
||||
fun acceptKotlinClass(tbi: ToBeImportedKotlin?) {}
|
||||
|
||||
internal fun acceptJavaClass(tbi: ToBeImportedJava?) {}
|
||||
fun acceptJavaClass(tbi: ToBeImportedJava?) {}
|
||||
|
||||
var ambiguousKotlin: IAmbiguousKotlin = AmbiguousKotlin() // Should not add import in case of 2 declarations in Kotlin
|
||||
|
||||
@@ -25,7 +25,7 @@ class Target {
|
||||
var ambiguousJava: IAmbiguousJava = AmbiguousJava() // Should not add import in case of 2 declarations in Java
|
||||
|
||||
|
||||
internal fun workWithStatics() {
|
||||
fun workWithStatics() {
|
||||
val a = TO_BE_IMPORTED_CONST
|
||||
staticMethod()
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
class A {
|
||||
val str: String = TODO()
|
||||
internal fun f() {
|
||||
fun f() {
|
||||
str.length
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
class Foo {
|
||||
var prop = 0
|
||||
internal fun foo() {
|
||||
fun foo() {
|
||||
prop++
|
||||
}
|
||||
}
|
||||
@@ -3,11 +3,11 @@ import java.util.ArrayList
|
||||
|
||||
|
||||
class A {
|
||||
internal fun foo() {
|
||||
fun foo() {
|
||||
val list = ArrayList<String>()
|
||||
list.add(1)
|
||||
}
|
||||
|
||||
internal fun bar() {}
|
||||
fun bar() {}
|
||||
|
||||
}
|
||||
@@ -3,9 +3,9 @@ package to
|
||||
import java.util.ArrayList
|
||||
|
||||
|
||||
internal fun foo() {
|
||||
fun foo() {
|
||||
val list = ArrayList<String>()
|
||||
list.add(1)
|
||||
}
|
||||
|
||||
internal fun bar() {}
|
||||
fun bar() {}
|
||||
|
||||
@@ -4,8 +4,8 @@ import java.io.File
|
||||
import java.util.ArrayList
|
||||
|
||||
|
||||
class JavaClass {
|
||||
internal fun foo(file: File?, target: MutableList<String>?) {
|
||||
internal class JavaClass {
|
||||
fun foo(file: File?, target: MutableList<String>?) {
|
||||
val list = ArrayList<String>()
|
||||
if (file != null) {
|
||||
list.add(file.name)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
val str: String = TODO()
|
||||
internal fun f() {
|
||||
fun f() {
|
||||
str.length
|
||||
}
|
||||
+2
-2
@@ -3,8 +3,8 @@ package to
|
||||
import java.util.ArrayList
|
||||
|
||||
|
||||
class JavaClass {
|
||||
internal fun foo() {
|
||||
internal class JavaClass {
|
||||
fun foo() {
|
||||
val list = ArrayList<String>()
|
||||
list.add(1)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user