code: public static void typeCheck(INode classdef, Interpreter interpreter,
  			CallSequence test, Environment outer) throws AnalysisException,
  			Exception
  	{
  		FlatEnvironment env = null;
  
  		if (classdef instanceof SClassDefinition)
  		{
  			env = new FlatEnvironment(interpreter.getAssistantFactory(), classdef.apply(interpreter.getAssistantFactory().getSelfDefinitionFinder()), outer);
  		} else
  		{
  			List<PDefinition> defs = new Vector<>();
  			
  			if(classdef instanceof AModuleModules)
  			{
  				defs.addAll(((AModuleModules) classdef).getDefs());
  			}
  			
  			env = new FlatEnvironment(interpreter.getAssistantFactory(), defs, outer);
  		}
  
  		for (int i = 0; i < test.size(); i++)
  		{
  			PStm statement = test.get(i);
  
  			if (statement instanceof TraceVariableStatement)
  			{
  				((TraceVariableStatement) statement).typeCheck(env, NameScope.NAMESANDSTATE);
  			} else
  			{
  				statement = statement.clone();
  				test.set(i, statement);
  				interpreter.typeCheck(statement, env);
  			}
  		}
  	}
docs: type check a test
  
  @param classdef
  @param interpreter
  @param test
  @throws AnalysisException
  @throws Exception