diff --git a/ufl/algorithms/analysis.py b/ufl/algorithms/analysis.py index 0df278ef2..71cbb33aa 100644 --- a/ufl/algorithms/analysis.py +++ b/ufl/algorithms/analysis.py @@ -91,8 +91,10 @@ def extract_type(a, ufl_types): # Extracting BaseArguments of an object of which a Coargument is an argument, # then we just return the dual argument of the Coargument and not its primal argument. if isinstance(ai, Coargument): - ufl_types = tuple(Coargument if t is BaseArgument else t for t in ufl_types) - base_form_objects += tuple(extract_type(ai, ufl_types)) + new_types = tuple(Coargument if t is BaseArgument else t for t in ufl_types) + base_form_objects += tuple(extract_type(ai, new_types)) + else: + base_form_objects += tuple(extract_type(ai, ufl_types)) # Look for BaseArguments in BaseFormOperator's argument slots only since that's where they are by definition. # Don't look into operands, which is convenient for external operator composition, e.g. N1(N2; v*) # where N2 is seen as an operator and not a form.