only stub default constructor when compiling against .java source files
This commit is contained in:
committed by
Alexander Udalov
parent
c83860187c
commit
7448761dfd
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
package test
|
||||
|
||||
fun foo(msg: String) = msg
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
OK
|
||||
Vendored
+4
@@ -0,0 +1,4 @@
|
||||
compiler/testData/compileKotlinAgainstCustomBinaries/classfileWithoutConstructors/shouldNotCompile.kt:6:9: error: unresolved reference: TopLevelKt
|
||||
TopLevelKt() // error here
|
||||
^
|
||||
COMPILATION_ERROR
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
package test
|
||||
|
||||
public class B {
|
||||
|
||||
public fun test(): String {
|
||||
TopLevelKt() // error here
|
||||
return TopLevelKt.foo("OK") // no error here: can still call static functions
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
package test;
|
||||
|
||||
public class ClassDefaultConstructor {
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
package test
|
||||
|
||||
fun useClassDefaultConstructor() = ClassDefaultConstructor()
|
||||
@@ -0,0 +1,7 @@
|
||||
package test
|
||||
|
||||
public fun useClassDefaultConstructor(): test.ClassDefaultConstructor
|
||||
|
||||
public open class ClassDefaultConstructor {
|
||||
public constructor ClassDefaultConstructor()
|
||||
}
|
||||
Reference in New Issue
Block a user