code: @Override
  	public PType caseACaseAlternativeStm(ACaseAlternativeStm node,
  			TypeCheckInfo question) throws AnalysisException
  	{
  
  		if (node.getDefs().size() == 0)
  		{
  			node.setDefs(new LinkedList<PDefinition>());
  			question.assistantFactory.createPPatternAssistant().typeResolve(node.getPattern(), THIS, question);
  
  			if (node.getPattern() instanceof AExpressionPattern)
  			{
  				// Only expression patterns need type checking...
  				AExpressionPattern ep = (AExpressionPattern) node.getPattern();
  				PType ptype = ep.getExp().apply(THIS, question);
  
  				if (!question.assistantFactory.getTypeComparator().compatible(ptype, node.getCtype()))
  				{
  					TypeCheckerErrors.report(3311, "Pattern cannot match", node.getPattern().getLocation(), node.getPattern());
  				}
  			}
  
  			question.assistantFactory.createPPatternAssistant().typeResolve(node.getPattern(), THIS, question);
  
  			ACasesStm stm = (ACasesStm) node.parent();
  			node.getDefs().addAll(question.assistantFactory.createPPatternAssistant().getDefinitions(node.getPattern(), stm.getExp().getType(), NameScope.LOCAL));
  		}
  
  		question.assistantFactory.createPDefinitionListAssistant().typeCheck(node.getDefs(), THIS, question);
  
  		if (!question.assistantFactory.createPPatternAssistant().matches(node.getPattern(), node.getCtype()))
  		{
  			TypeCheckerErrors.report(3311, "Pattern cannot match", node.getPattern().getLocation(), node.getPattern());
  		}
  
  		Environment local = new FlatCheckedEnvironment(question.assistantFactory, node.getDefs(), question.env, question.scope);
  		PType r = node.getResult().apply(THIS, new TypeCheckInfo(question.assistantFactory, local, question.scope, null, null, question.returnType));
  		local.unusedCheck();
  
  		return r;
  	}
docs: TODO correct, possibly wrong typecheck implementation