groovy/groovy-core — pull request #475 by tombensve (2014-07-07 14:23:15+00:00)
Title: NPE during compile of code annotated with @CompileStatic fix

I kept getting an NPE from the Groovy compiler when compiling my code, and a full stack trace showed it to be in org.codehaus.groovy.transform.stc.StaticTypeCheckingSupport.isAssignableTo(ClassNode type, ClassNode toBeAssignedTo). In some cases the second parameter (toBeAssignedTo) is null which makes "if (toBeAssignedTo.redirect() ..." throw an NPE. So I added an "if (toBeAssignedTo == null) return true;" as first line, and that seemed to solve the problem. I resolved that the value should be true by testing both false and true. When false I got 7 completely incorrect errors. When true I got 2 very correct errors. Thereby I went with true.