File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
codegen/src/main/kotlin/co/selim/ebservice/codegen Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -71,11 +71,15 @@ class ServiceProcessor : AbstractProcessor() {
7171 logError(" Function ${kmFunction.name} must be suspending" )
7272 }
7373
74+ if (kmFunction.returnType.toTypeName() == Unit ::class .asTypeName() && kmFunction.isSuspend) {
75+ logInfo(" Function ${kmFunction.name} doesn't need to be suspending" )
76+ }
77+
7478 val parameters = kmFunction.valueParameters
7579 .asSequence()
7680 .onEach { parameter ->
7781 if (parameter.varargElementType != null ) {
78- logError(" Vararg parameters are not supported by ebservice" )
82+ logError(" Vararg parameters in function ${kmFunction.name} are not supported by ebservice" )
7983 }
8084 }
8185 .filter { parameter ->
@@ -100,6 +104,10 @@ class ServiceProcessor : AbstractProcessor() {
100104 processingEnv.messager.printMessage(Diagnostic .Kind .ERROR , msg, element)
101105 }
102106
107+ private fun logInfo (msg : String , element : Element ? = null) {
108+ processingEnv.messager.printMessage(Diagnostic .Kind .NOTE , msg, element)
109+ }
110+
103111 private fun KmType.toTypeName (): TypeName {
104112 val params: List <TypeName > = arguments.mapNotNull { typeProjection ->
105113 typeProjection.type?.toTypeName()?.copy(nullable = typeProjection.type!! .isNullable)
You can’t perform that action at this time.
0 commit comments