From 5e13851532520f8dac067557f44d3918b5b98a55 Mon Sep 17 00:00:00 2001 From: Tobias Reiher Date: Tue, 16 Aug 2022 15:20:42 +0200 Subject: [PATCH] Refactor initialization of error object Ref. #1120, #1134 --- rflx/expression.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/rflx/expression.py b/rflx/expression.py index 7e616d856..aa7c11ea8 100644 --- a/rflx/expression.py +++ b/rflx/expression.py @@ -2805,15 +2805,14 @@ def _update_str(self) -> None: self._str = intern(f"{self.identifier} with delta {field_values}") def _check_type_subexpr(self) -> RecordFluxError: - if not isinstance(self.type_, rty.Message): - error = RecordFluxError() + error = RecordFluxError() + if not isinstance(self.type_, rty.Message): for d in self.field_values.values(): error += d.check_type_instance(rty.Any) return error - error = RecordFluxError() field_combinations = set(self.type_.field_combinations) fields: tuple[str, ...] = ()