Validation Issues: The field Tmp_lightRules.myMap refers to the missing type Object

I have been trying to use a HashSet or a HashMap (following examples from this forum). Everytime I use myMap in a rule, I get an additional line “The field Tmp_lightRules.myMap refers to the missing type Object”. The hashMap works as expected, but I would like to get rid of the warnings.

Any clue what is incorrect about this?

import java.util.Map

var Map<String,DateTime> myMap = newHashMap

rule "Debug Rule"
when 
    Item DebugRule changed
then
    myMap.put("aaa", now)
    if (myMap.containsKey("aaa")) {
        logInfo("light.rules", "Test!!!")
    }
end
var myMap = <String, ZonedDateTime>newHashMap

rule "Debug Rule"
when 
    Item DebugRule changed
then
    myMap.put("aaa", now)
    if (myMap.containsKey("aaa")) {
        logInfo("light.rules", "Test!!!")
    }
end

Thanks! I will remember not to use DateTime anymore. That explains too why I was getting all kind of weird exceptions when using that type.