def test_rev_const_flatten_tuple(self): rev_const_type = CompositeType({ ("get", 0): GetterMicroOpType(0, StringType()), ("set", 0): SetterMicroOpType(0, AnyType()) }, name="test") normal_broad_type = CompositeType({ ("get", 0): GetterMicroOpType(0, StringType()), ("set", 0): SetterMicroOpType(0, StringType()) }, name="test") rev_const_type = prepare_lhs_type(rev_const_type, None) self.assertTrue(isinstance(rev_const_type.get_micro_op_type(("set", 0)).value_type, StringType)) self.assertTrue(normal_broad_type.is_copyable_from(rev_const_type, DUMMY_REASONER))
def test_rev_const_wildcard(self): rev_const_type = CompositeType({ ("get-wildcard", ): GetterWildcardMicroOpType(StringType(), StringType(), True), ("set-wildcard", ): SetterWildcardMicroOpType(StringType(), AnyType(), False, False) }, name="test") normal_broad_type = CompositeType({ ("get", "foo"): GetterWildcardMicroOpType(StringType(), StringType(), True), ("set", "foo"): SetterWildcardMicroOpType(StringType(), StringType(), False, False) }, name="test") rev_const_type = prepare_lhs_type(rev_const_type, None) self.assertTrue(isinstance(rev_const_type.get_micro_op_type(("set-wildcard",)).value_type, StringType)) self.assertTrue(normal_broad_type.is_copyable_from(rev_const_type, DUMMY_REASONER))