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
valueType = targetType == null
                || targetType.targetType() == ZonedDateTime.class
                || semanticScope.getCondition(userBraceNode, Explicit.class) ? def.class : targetType.targetType();
            if (write) {
                semanticScope.setCondition(userBraceNode, DefOptimized.class);
            }
        } else if (Map.class.isAssignableFrom(prefixValueType)) {
            String canonicalClassName = PainlessLookupUtility.typeToCanonicalTypeName(prefixValueType);
            PainlessMethod getter = semanticScope.getScriptScope()
                .getPainlessLookup()
                .lookupPainlessMethod(prefixValueType, false, "get", 1);
            PainlessMethod setter = semanticScope.getScriptScope()
                .getPainlessLookup()
                .lookupPainlessMethod(prefixValueType, false, "put", 2);
            if (getter != null && (getter.returnType() == void.class || getter.typeParameters().size() != 1)) {
                throw userBraceNode.createError(
                    new IllegalArgumentException("Illegal map get shortcut for type [" + canonicalClassName + "].")
                );
            }
            if (setter != null && setter.typeParameters().size() != 2) {
                throw userBraceNode.createError(
                    new IllegalArgumentException("Illegal map set shortcut for type [" + canonicalClassName + "].")
                );
            }
            if (getter != null
                && setter != null
                && (getter.typeParameters().get(0).equals(setter.typeParameters().get(0)) == false
                    || getter.returnType().equals(setter.typeParameters().get(1)) == false)) {
                throw userBraceNode.createError(new IllegalArgumentException("Shortcut argument types must match."));