This is my first attempt at switching to Kotlin but I’m stuck.
I have an existing java project so I figured the easiest way to switch to Kotlin was to automatically convert one of my unit test classes (by using Code -> Convert Java File to Kotlin File).
My test creates some data with a specific pattern and ensures the pattern is detected by checking that the detected representation object is of the correct class.
This line gets converted to:
If I try to rebuild the project, I get the following errors:
Error:(21, 6) Kotlin: Cannot access class ‘kotlin.reflect.KClass’. Check your module classpath for missing or conflicting dependencies
Error:(28, 51) Kotlin: Unresolved reference: java
Error:(28, 63) Kotlin: Unresolved reference: javaClass
This unit test class is the first class being converted to Kotlin so I want this to work before I convert anything else. I’m using IntelliJ Ultimate 2017.1.4 and I’m not using Maven so it’s just a simple java project.