summaryrefslogtreecommitdiff
path: root/grc/core/Connection.py
diff options
context:
space:
mode:
authorRyan Volz <ryan.volz@gmail.com>2021-10-11 15:02:55 -0400
committermormj <34754695+mormj@users.noreply.github.com>2021-10-12 06:24:01 -0400
commit06dc1a9fca3bd1a2421e1a19fd6374519349d8d9 (patch)
tree15e563fcd5af95ff8b54ddbdcb3a362f6b8b966b /grc/core/Connection.py
parente50c3f80dd68c29f0f1331692dedefb95ab46ca7 (diff)
grc: Look up type aliases as a set instead of a single value.
After #5127, we inadvertently had duplicate dictionary keys, meaning the last entry is the only one that actually existed and some desired aliases were missing. This changes the ALIAS_OF dictionary to ALIASES_OF where the values are now a set of aliases instead of a single string value. The one use of the ALIAS_OF dictionary was changed to operate on the returned set. Signed-off-by: Ryan Volz <ryan.volz@gmail.com>
Diffstat (limited to 'grc/core/Connection.py')
-rw-r--r--grc/core/Connection.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/grc/core/Connection.py b/grc/core/Connection.py
index 718dd69e71..f979efb3e4 100644
--- a/grc/core/Connection.py
+++ b/grc/core/Connection.py
@@ -8,7 +8,7 @@ SPDX-License-Identifier: GPL-2.0-or-later
from .base import Element
-from .Constants import ALIAS_OF
+from .Constants import ALIASES_OF
from .utils.descriptors import lazy_property
@@ -93,7 +93,7 @@ class Connection(Element):
source_dtype = self.source_port.dtype
sink_dtype = self.sink_port.dtype
- if source_dtype != sink_dtype and source_dtype != ALIAS_OF.get(sink_dtype):
+ if source_dtype != sink_dtype and source_dtype not in ALIASES_OF.get(sink_dtype):
self.add_error_message('Source IO type "{}" does not match sink IO type "{}".'.format(source_dtype, sink_dtype))
source_size = self.source_port.item_size