opkend.blogg.se

Kotlin unresolved reference
Kotlin unresolved reference







kotlin unresolved reference

In this case, the specific error is because Number is not Comparable, and so you can't use it in combination with the < operator. Number is an interface, and although it's implemented by many numeric classes ( Int, Short, Byte, Long, Float, Double, BigInteger, BigDecimal, &c), it's very limited and not very useful in practice. About all you can do with it is convert it to standard numeric types - it has toFloat(), toInt(), &c methods - but it provides no way to do arithmetic, comparison, or other numeric operations.

kotlin unresolved reference

I went into the project settings and noticed the compiler versions were not set to java 8, I set the Compiler/Kotlin/Target JVM Version and Compiler/Java/Project Byte Code to 1.8/8 (see below), then ran some tests in the IDE and we are back in business! References resolved in my case.Short answer: use a concrete type such as Int instead of Number. After rebuilding the project still no joy. My project (at time of writing this) is a gradle 4.10.2 kotlin 1.3 project in IntelliJ (IntelliJ IDEA 2018.2.5 (Ultimate Edition) Build #IU-182.4892.20, built on October 16, 2018)įor starters though, I invalidated caches and restarted. However the code panel has no red lines indicating that modules can't be found or imported or anything untoward.

kotlin unresolved reference

This was the sort of symptom the IDE was displaying in the message panel after trying to run tests via the IDE. I have tried a number of things mentioned on this page but not without complete success. Ok, i've been here a few times and not entirely sure how or why this happens but reading suggests its a Kotlin/JVM mismatch.









Kotlin unresolved reference