diff --git a/phasm/type3/constraints.py b/phasm/type3/constraints.py index 3610e6c..40bc2f1 100644 --- a/phasm/type3/constraints.py +++ b/phasm/type3/constraints.py @@ -108,7 +108,7 @@ class SameTypeConstraint(ConstraintBase): placeholders = [] do_applied_placeholder_check: bool = False for typ in self.type_list: - if isinstance(typ, types.PrimitiveType3): + if isinstance(typ, (types.PrimitiveType3, types.StructType3, )): known_types.append(typ) continue diff --git a/phasm/type3/entry.py b/phasm/type3/entry.py index fe529fa..4310955 100644 --- a/phasm/type3/entry.py +++ b/phasm/type3/entry.py @@ -8,7 +8,7 @@ from .. import ourlang from .constraints import ConstraintBase, Error, RequireTypeSubstitutes, SameTypeConstraint, SubstitutionMap from .constraintsgenerator import phasm_type3_generate_constraints -from .types import AppliedType3, PlaceholderForType, PrimitiveType3, Type3, Type3OrPlaceholder +from .types import AppliedType3, PlaceholderForType, PrimitiveType3, StructType3, Type3, Type3OrPlaceholder MAX_RESTACK_COUNT = 100 @@ -125,7 +125,7 @@ def print_constraint(placeholder_id_map: Dict[int, str], constraint: ConstraintB print('- ' + txt.format(**act_fmt)) def get_printable_type_name(inp: Type3OrPlaceholder, placeholder_id_map: Dict[int, str]) -> str: - if isinstance(inp, PrimitiveType3): + if isinstance(inp, (PrimitiveType3, StructType3, )): return inp.name if isinstance(inp, PlaceholderForType): diff --git a/tests/integration/test_lang/test_tuple.py b/tests/integration/test_lang/test_tuple.py index 4ed482f..a238932 100644 --- a/tests/integration/test_lang/test_tuple.py +++ b/tests/integration/test_lang/test_tuple.py @@ -2,7 +2,7 @@ import pytest from phasm.type3.entry import Type3Exception -from ..constants import ALL_FLOAT_TYPES, COMPLETE_NUMERIC_TYPES, TYPE_MAP +from ..constants import ALL_FLOAT_TYPES, COMPLETE_INT_TYPES, TYPE_MAP from ..helpers import Suite @pytest.mark.integration_test @@ -82,7 +82,7 @@ def helper(x: u8) -> u8: Suite(code_py).run_code() @pytest.mark.integration_test -@pytest.mark.parametrize('type_', COMPLETE_NUMERIC_TYPES) +@pytest.mark.parametrize('type_', COMPLETE_INT_TYPES) def test_tuple_simple_constructor_int(type_): code_py = f""" @exported