Fixed a wrong test that the new typer caught
Also, some fixes of things that were broken on structs due to the tuple changes
This commit is contained in:
parent
7f0acf00fe
commit
f281b78c78
@ -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
|
||||
|
||||
|
||||
@ -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):
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user