only stub default constructor when compiling against .java source files
This commit is contained in:
committed by
Alexander Udalov
parent
c83860187c
commit
7448761dfd
+1
@@ -159,6 +159,7 @@ class MockKotlinClassifier(override val classId: ClassId,
|
||||
override val methods get() = shouldNotBeCalled()
|
||||
override val fields get() = shouldNotBeCalled()
|
||||
override val constructors get() = shouldNotBeCalled()
|
||||
override fun hasDefaultConstructor() = shouldNotBeCalled()
|
||||
override val annotations get() = shouldNotBeCalled()
|
||||
override val isDeprecatedInJavaDoc get() = shouldNotBeCalled()
|
||||
override fun findAnnotation(fqName: FqName) = shouldNotBeCalled()
|
||||
|
||||
+2
@@ -73,6 +73,8 @@ class FakeSymbolBasedClass(
|
||||
|
||||
override val constructors: Collection<JavaConstructor> get() = emptyList()
|
||||
|
||||
override fun hasDefaultConstructor() = false
|
||||
|
||||
override val innerClassNames: Collection<Name> get() = emptyList()
|
||||
|
||||
override val virtualFile: VirtualFile? by lazy {
|
||||
|
||||
+2
@@ -133,6 +133,8 @@ class SymbolBasedClass(
|
||||
.filter { it.kind == ElementKind.CONSTRUCTOR }
|
||||
.map { SymbolBasedConstructor(it as ExecutableElement, this, javac) }
|
||||
|
||||
override fun hasDefaultConstructor() = false // default constructors are explicit in symbols
|
||||
|
||||
override val innerClassNames: Collection<Name>
|
||||
get() = innerClasses.keys
|
||||
|
||||
|
||||
@@ -134,6 +134,8 @@ class TreeBasedClass(
|
||||
TreeBasedConstructor(constructor as JCTree.JCMethodDecl, compilationUnit, this, javac)
|
||||
}
|
||||
|
||||
override fun hasDefaultConstructor() = !isInterface && constructors.isEmpty()
|
||||
|
||||
override val innerClassNames: Collection<Name>
|
||||
get() = innerClasses.keys
|
||||
|
||||
|
||||
Reference in New Issue
Block a user