I got an unexpected internal NPE when playing with this script.

```
POST _scripts/painless/_execute
{
  "script": {
    "source": """
    return /[^\w]+/.split('abc   def higkln').toArray(String[]::new)
    """
  }
}
```
```
{
  "error" : {
    "root_cause" : [
      {
        "type" : "script_exception",
        "reason" : "compile error",
        "script_stack" : [ ],
        "script" : "\n    return /[^\\w]+/.split('abc   def higkln').toArray(String[]::new)\n    ",
        "lang" : "painless"
      }
    ],
    "type" : "script_exception",
    "reason" : "compile error",
    "script_stack" : [ ],
    "script" : "\n    return /[^\\w]+/.split('abc   def higkln').toArray(String[]::new)\n    ",
    "lang" : "painless",
    "caused_by" : {
      "type" : "null_pointer_exception",
      "reason" : "Cannot read field \"annotations\" because the return value of \"org.elasticsearch.painless.lookup.PainlessLookup.lookupPainlessClass(java.lang.Class)\" is null"
    }
  },
  "status" : 400
}

```
modules/lang-painless/src/main/java/org/elasticsearch/painless/phase/DefaultSemanticAnalysisPhase.java
scriptScope.getCompilerSettings().asMap(),
                        false
                    );
                    semanticScope.putDecoration(userFunctionRefNode, new ReferenceDecoration(ref));
                }
            }
        }
        semanticScope.putDecoration(userFunctionRefNode, new ValueType(valueType));
    }
    /**
     * Visits a new array function ref expression which covers only a new array function reference
     * and generates an internal method to define the new array.
     * Checks: type validation
     */
    @Override
    public void visitNewArrayFunctionRef(ENewArrayFunctionRef userNewArrayFunctionRefNode, SemanticScope semanticScope) {
        String canonicalTypeName = userNewArrayFunctionRefNode.getCanonicalTypeName();
        if (semanticScope.getCondition(userNewArrayFunctionRefNode, Write.class)) {
            throw userNewArrayFunctionRefNode.createError(
                new IllegalArgumentException(
                    "cannot assign a value to new array function reference with target type [ + " + canonicalTypeName + "]"
                )
            );
        }
        if (semanticScope.getCondition(userNewArrayFunctionRefNode, Read.class) == false) {
            throw userNewArrayFunctionRefNode.createError(
                new IllegalArgumentException(
                    "not a statement: new array function reference with target type [" + canonicalTypeName + "] not used"
                )
            );