From d44ee73deeaab86a7cc5820ef62688f291331b88 Mon Sep 17 00:00:00 2001
From: Volker Schroer <3470424+dl1ksv@users.noreply.github.com>
Date: Mon, 5 Apr 2021 17:29:02 +0200
Subject: grc: Check connection types, whether they match

Signed-off-by: Volker Schroer <3470424+dl1ksv@users.noreply.github.com>
---
 grc/core/Connection.py | 5 +++++
 1 file changed, 5 insertions(+)

(limited to 'grc/core/Connection.py')

diff --git a/grc/core/Connection.py b/grc/core/Connection.py
index f5a466f246..6fd78a41f1 100644
--- a/grc/core/Connection.py
+++ b/grc/core/Connection.py
@@ -90,6 +90,11 @@ class Connection(Element):
             self.add_error_message('No connection known between domains "{}" and "{}"'
                                    ''.format(*self.type))
 
+        source_dtype = self.source_port.dtype
+        sink_dtype = self.sink_port.dtype
+        if source_dtype != 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
         sink_size = self.sink_port.item_size
         if source_size != sink_size:
-- 
cgit v1.2.3