From 869d901ad038ee55cd2f114ff676d4706136ca82 Mon Sep 17 00:00:00 2001 From: Stephan Seitz <stephan.seitz@fau.de> Date: Thu, 29 Aug 2019 14:27:46 +0200 Subject: [PATCH] Restore previous behavior of get_type_of_expression for untyped symbol --- pystencils/data_types.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pystencils/data_types.py b/pystencils/data_types.py index 079f5b14..3880edbc 100644 --- a/pystencils/data_types.py +++ b/pystencils/data_types.py @@ -436,8 +436,10 @@ def get_type_of_expression(expr, elif isinstance(expr, TypedSymbol): return expr.dtype elif isinstance(expr, sp.Symbol): - return symbol_type_dict[expr.name] - # raise ValueError("All symbols iside this expression have to be typed! ", str(expr)) + if symbol_type_dict: + return symbol_type_dict[expr.name] + else: + raise ValueError("All symbols inside this expression have to be typed! ", str(expr)) elif isinstance(expr, cast_func): return expr.args[1] elif isinstance(expr, (vec_any, vec_all)): -- GitLab