class CollisionOfTanks(val Ob1:InterfaceIObject, val Ob2:InterfaceIObject, val map:HashMap<Int,HashMap<Int,HashMap<Int,Int>>>) val collision = map.getOrDefault(1 to hashMapOf(direction1 to hashMapOf(coordinates1[0] to coordinates1[1])), 42) Gives an error message
Type inference failed. The value of the parameter should be referred to as the type, receiver type or expected type. Try to specify it explicitly.
I tried to specify a type like this:
val collision = map.getOrDefault<HashMap<Int,HashMap<Int,HashMap<Int,Int>>>, Int>(1 to hashMapOf(direction1 to hashMapOf(coordinates1[0] to coordinates1[1])), 42) But then it writes in general
GetOrDefault (key: Int, defaultValue: HashMap>): HashMap>
How to fix it? Or replace? I just need to know if there is any value for this key.