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
import org.elasticsearch.painless.symbol.Decorations.StaticType;
import org.elasticsearch.painless.symbol.Decorations.TargetType;
import org.elasticsearch.painless.symbol.Decorations.ThisPainlessMethod;
import org.elasticsearch.painless.symbol.Decorations.TypeParameters;
import org.elasticsearch.painless.symbol.Decorations.UnaryType;
import org.elasticsearch.painless.symbol.Decorations.UpcastPainlessCast;
import org.elasticsearch.painless.symbol.Decorations.ValueType;
import org.elasticsearch.painless.symbol.Decorations.Write;
import org.elasticsearch.painless.symbol.FunctionTable;
import org.elasticsearch.painless.symbol.FunctionTable.LocalFunction;
import org.elasticsearch.painless.symbol.ScriptScope;
import org.elasticsearch.painless.symbol.SemanticScope;
import org.elasticsearch.painless.symbol.SemanticScope.FunctionScope;
import org.elasticsearch.painless.symbol.SemanticScope.LambdaScope;
import org.elasticsearch.painless.symbol.SemanticScope.Variable;
import java.lang.reflect.Modifier;
import java.time.ZonedDateTime;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.regex.Pattern;
import java.util.regex.PatternSyntaxException;
import static org.elasticsearch.painless.lookup.PainlessLookupUtility.typeToCanonicalTypeName;
import static org.elasticsearch.painless.symbol.SemanticScope.newFunctionScope;
/**
 * Semantically validates a user tree visiting all user tree nodes to check for
 * valid control flow, valid types, valid variable resolution, valid method resolution,