IllegalArgumentException with IntersectionTypeConstructor

I am implementing Sonar to connect to SonarCloud for the first time on my kotlin project. I have set Sonarqube at 3.5.0.2730, using Cover 0.6.1. The build server (Gitlab) was already configured to pick up Sonar configurations (IE it’s already running the sonar gradle task if configured for the project), so I was just plugging it in to my build.gradle file.

The task runs fine. Sonar is running, and reports successful, but in the log is the following caveat.

> Task :sonar
Cannot analyse 'src/main/kotlin/md/quin/process/flow/common/flow/fhir/FhirStepConverter.kt' with 'KtChecksVisitor': declarationDescriptor is null for constructor = {String & Type} with class org.jetbrains.kotlin.types.IntersectionTypeConstructor
java.lang.IllegalArgumentException: declarationDescriptor is null for constructor = {String & Type} with class org.jetbrains.kotlin.types.IntersectionTypeConstructor

along with a very long stack trace.

Now FhirStepConverter.kt is a file with no classes in it, only functions, and I am wondering whether that’s why. The file is under test, so I am certainly expecting/hoping for Sonar results, it just has no class (and therefore no constructors).

Kover does report results on the file (99% line coverage), so it is getting analyzed, I am not sure what Sonar is asking for, if the Kover results are there.

1 Like

Hi,

Welcome to the community!

Before we get into the specifics of your question, I need to nail down some fundamentals.

First, are you trying to use SonarQube or SonarCloud? And if the former, what version? (You’ll find it in the SonarQube page footer).

 
Ann