build.gradle file, task using << notation, intellij warns: "Cannot infer argument type"

Viewed 18040

I'm new to groovy and gradle and was wondering whether someone knew why my scriplet wasn't working (edit actually it does work but the warning still appears). This section is taken out of the build.gradle script and intellij highlights this and complains that it: "Cannot infer argument types". any help would be nice :)

task hellofun << {
    [silly:'billy'].each { k, v ->
        println "$k=$v"
    }
}

EDIT: I have submitted a bug request informing Intellij of this problem

EDIT: apparently this is a known bug I'll update this once the bug is fixed

5 Answers

In Intelij press Double shift (search all) enter "Assignment Issues" and change Assignment Issues: Incompatible type assignments inspection to "OFF"

Related