code: private List<Snippet> compileFailResult(DiagList diags, String userSource, Kind probableKind) {
          ErroneousKey key = state.keyMap.keyForErroneous();
          Snippet snip = new ErroneousSnippet(key, userSource, null,
                  probableKind, SubKind.UNKNOWN_SUBKIND);
          snip.setFailed(diags);
  
          // Install  wrapper for query by SourceCodeAnalysis.wrapper
          String compileSource = Util.trimEnd(new MaskCommentsAndModifiers(userSource, true).cleared());
          OuterWrap outer;
          switch (probableKind) {
              case IMPORT:
                  outer = state.outerMap.wrapImport(Wrap.simpleWrap(compileSource), snip);
                  break;
              case EXPRESSION:
                  outer = state.outerMap.wrapInTrialClass(Wrap.methodReturnWrap(compileSource));
                  break;
              case VAR:
              case TYPE_DECL:
              case METHOD:
                  outer = state.outerMap.wrapInTrialClass(Wrap.classMemberWrap(compileSource));
                  break;
              default:
                  outer = state.outerMap.wrapInTrialClass(Wrap.methodWrap(compileSource));
                  break;
          }
          snip.setOuterWrap(outer);
  
          return singletonList(snip);
      }
docs: The snippet has failed, return with the rejected snippet
  
  @param diags the failure diagnostics
  @param userSource the incoming bad user source
  @return a rejected snippet