protected void checkArguments(List<? extends AnnotatedTypeMirror> requiredArgs,List<? extends ExpressionTree> passedArgs){
  assert requiredArgs.size() == passedArgs.size() : "mismatch between required args (" + requiredArgs + ") and passed args ("+ passedArgs+ ")";
  Pair<Tree,AnnotatedTypeMirror> preAssCtxt=visitorState.getAssignmentContext();
  try {
    for (int i=0; i < requiredArgs.size(); ++i) {
      visitorState.setAssignmentContext(Pair.<Tree,AnnotatedTypeMirror>of((Tree)null,(AnnotatedTypeMirror)requiredArgs.get(i)));
      commonAssignmentCheck(requiredArgs.get(i),passedArgs.get(i),"argument.type.incompatible");
      scan(passedArgs.get(i),null);
    }
  }
  finally {
    visitorState.setAssignmentContext(preAssCtxt);
  }
}

protected void checkArguments ( List < ? extends AnnotatedTypeMirror > requiredArgs , List < ? extends ExpressionTree > passedArgs ) { assert requiredArgs . size ( ) == passedArgs . size ( ) : "mismatch between required args (" + requiredArgs + ") and passed args (" + passedArgs + ")" ; Pair < Tree , AnnotatedTypeMirror > preAssCtxt = visitorState . getAssignmentContext ( ) ; try { for ( int i = 0 ; i < requiredArgs . size ( ) ; ++ i ) { visitorState . setAssignmentContext ( Pair . < Tree , AnnotatedTypeMirror > of ( ( Tree ) null , ( AnnotatedTypeMirror ) requiredArgs . get ( i ) ) ) ; commonAssignmentCheck ( requiredArgs . get ( i ) , passedArgs . get ( i ) , "argument.type.incompatible" ) ; scan ( passedArgs . get ( i ) , null ) ; } } finally { visitorState . setAssignmentContext ( preAssCtxt ) ; } }
a helper method to check that each passed argument is a subtype of the corresponding required argument , and issues " argument . invalid " error for each passed argument that not a subtype of the required one . note this method requires the lists to have the same length , as it does not handle cases like var args .
