if( isSeqApply( (Apply) tree )) return mk.SeqContainerPat( tree.pos, theType, args[ 0 ] );
if( isSeqApply( (Apply) tree )) { PatternNode res = mk.ConstrPat(tree.pos, theType); res.and = mk.Header(tree.pos, castType, selector); res.and.and = mk.SeqContainerPat( tree.pos, theType, args[ 0 ] ); return res; }
      protected PatternNode patternNode(Tree tree,                                       Type castType,                                       Tree selector,                                       CaseEnv env) {          Type theType = getConstrType( tree.type );          switch (tree) {	  case Apply(Tree fn, Tree[] args):             // pattern with args	      if( isSeqApply( (Apply) tree ))		  return mk.SeqContainerPat( tree.pos, theType, args[ 0 ] );	      return mk.ConstrPat(tree.pos, theType);          case Typed(Ident(Name name), Tree tpe):       // typed pattern                theType = getConstrType( tpe.type );                assert (env != null ) : "env is null";                if (/*(env != null) &&*/ (name != Names.WILDCARD))                      env.newBoundVar(tree.pos,                                       ((Tree.Typed)tree).expr.symbol(),                                       theType,                                       selector);                if (castType.isSubType( theType ))                      // castType is a subtype of theType                      return mk.DefaultPat( tree.pos, theType );                else                      return mk.ConstrPat( tree.pos, theType );          case Bind(Name name, Ident(Name id)): // x @ _                if( id == Names.WILDCARD ) {                      env.newBoundVar(tree.pos,                                       tree.symbol(),                                       theType,                                       selector);                      return mk.DefaultPat(tree.pos, getConstrType(castType));                }                throw new ApplicationError("cannot handle "+tree);          case Ident(Name name):        // pattern without args or variable                if ((tree.symbol() != null) && tree.symbol().isPrimaryConstructor())                      return mk.ConstrPat(tree.pos, theType);                else if (name.isVariable()) {                      assert (env != null ) : "env is null";                      if (/*(env != null) &&*/ (name != Names.WILDCARD))                            env.newBoundVar(tree.pos,                                             tree.symbol(),                                             theType,                                             selector);                      return mk.DefaultPat(tree.pos, getConstrType(castType));                } else                      return mk.VariablePat(tree.pos, tree);          case Select(_, Name name):                                    // variable                if (tree.symbol().isPrimaryConstructor())                      return mk.ConstrPat(tree.pos, theType);                else                    return mk.VariablePat(tree.pos, tree);          case Literal(Object value):	      return mk.ConstantPat(tree.pos, theType, value);                	  case Sequence( _ ):	      throw new ApplicationError("Illegal pattern");	  default:	      throw new ApplicationError("cannot handle "+tree);	  }      }