https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
r

Robert Jaros

04/13/2022, 1:19 PM
In my KMP project, after upgrade to Kotlin 1.6.20, I see this error in IntelliJ only (no error when building from gradle). Is this correct behavior?
1
ServiceException
is defined in my common module like this:
Copy code
class ServiceException(message: String) : Exception(message)
a

Anthony Martin

04/13/2022, 1:56 PM
Which Exception are you importing in ServiceException?
r

Robert Jaros

04/13/2022, 1:58 PM
I'm not importing anything, so I assume it is
kotlin.Exception
a

Anthony Martin

04/13/2022, 1:59 PM
Try extending java.lang.Exception instead
r

Robert Jaros

04/13/2022, 2:00 PM
It's common code. I can't use java.lang.*
a

Anthony Martin

04/13/2022, 2:01 PM
Ah try
e: java.lang.Exception
?
r

Robert Jaros

04/13/2022, 2:02 PM
The same error just a bit different message
Incompatible types: ServiceException and Exception