error with empty calculator
According to grammar this statement is allowed: calc = Calculator emt ()
. But I get an error during type checking:
Traceback (most recent call last):
File "vre-language/src/virtmat/language/utilities/errors.py", line 91, in wrapper
return func(*args, **kwargs)
File "vre-language/examples/../scripts/run_model.py", line 54, in run_instant_deferred
return meta.model_from_file(clargs.model_file, deferred_mode=deferred,
File "python-3.10.6/lib/python3.10/site-packages/textx/metamodel.py", line 658, in model_from_file
return self.internal_model_from_file(
File "python-3.10.6/lib/python3.10/site-packages/textx/metamodel.py", line 712, in internal_model_from_file
p(model, self)
File "vre-language/src/virtmat/language/constraints/typechecks.py", line 59, in check_types_processor
_ = obj.type_
File "/usr/lib/python3.10/functools.py", line 981, in __get__
val = self.func(instance)
File "vre-language/src/virtmat/language/constraints/typechecks.py", line 97, in variable_type
return self.parameter.type_
File "/usr/lib/python3.10/functools.py", line 981, in __get__
val = self.func(instance)
File "vre-language/src/virtmat/language/constraints/typechecks.py", line 845, in amml_calculator_type
if isinstance_m(self.parameters, ['Table']):
File "vre-language/src/virtmat/language/utilities/textx.py", line 17, in isinstance_m
meta = get_metamodel(obj)
File "python-3.10.6/lib/python3.10/site-packages/textx/model.py", line 67, in get_metamodel
return get_model(obj)._tx_metamodel
AttributeError: 'NoneType' object has no attribute '_tx_metamodel'
Obviously default
is False
and parameters
is None
but this is no valid case. If default
is False
then parameters
may not be None
. If default
is True
then parameters
must be None
. Either the grammar must be changed to disallow these combinations or the constraints must be fixed.
Edited by Ivan Kondov