lib/cel/checker.rb in cel-0.2.0 vs lib/cel/checker.rb in cel-0.2.1

- old
+ new

@@ -146,11 +146,11 @@ # A field selection expression, e.f, can be applied both to messages and # to maps. For maps, selection is interpreted as the field being a string key. case func when :[] attribute = var_type.get(args) - unsupported_operation(funcall) unless attribute + return TYPES[:any] unless attribute when :all, :exists, :exists_one check_arity(funcall, args, 2) identifier, predicate = args unsupported_type(funcall) unless identifier.is_a?(Identifier) @@ -160,11 +160,11 @@ unsupported_type(funcall) if element_checker.check(predicate) != :bool return TYPES[:bool] else attribute = var_type.get(func) - unsupported_operation(funcall) unless attribute + return TYPES[:any] unless attribute end call(attribute) when ListType case func @@ -379,10 +379,10 @@ else types == expected_type end end - TYPES[type] + type && types.is_a?(Type) ? types : TYPES[type] end def check_arity(func, args, arity) return if arity === args.size # rubocop:disable Style/CaseEquality