Odd "Cannot assign 'Type' to 'null'" Diagnostic

Hi,

In this Grails controller action closure, each of the method calls (the name and the arguments) are flagged with the error message "Cannot assign 'Clif' to 'null'" (pathLookup(...) and Clif.loadClif(...) both are declared to return type Clif):


If I change the local variable declaration from a "def" to "Clif" the diagnostics disappear. pathLookup() is not overloaded, Clif.loadClif(...) is.


Randall Schulz

3 comments
Comment actions Permalink

Hello Randall,
this was the problem I was fighting during my last days at JetBrains. Unfortunately at that time I was unable to come up with any solution that wouldn't break anything. Now seems I know how this should look like, and in case my commit to the repository didn't break any tests (I don't currently have an access to build server), that I hope it won't, the bug may be considered fixed.

0
Comment actions Permalink

JIRA request please?

0
Comment actions Permalink

Oops, sorry

0

Please sign in to leave a comment.