def instantiate_type(self, typename, base, subtypes):
if base not in self.type_factories:<EOL><INDENT>raise ArgumentError("<STR_LIT>", passed_type=typename, base_type=base)<EOL><DEDENT>base_type = self.type_factories[base]<EOL>for sub_type in subtypes:<EOL><INDENT>try:<EOL><INDENT>self.get_type(sub_type)<EOL><DEDENT>except KeyValueException as exc:<EOL><INDENT>raise ArgumentError("<STR_LIT>", passed_type=typename, sub_type=sub_type, error=exc)<EOL><DEDENT><DEDENT>typeobj = base_type.Build(*subtypes, type_system=self)<EOL>self.inject_type(typename, typeobj)<EOL>
Instantiate a complex type.