Adds a FIXME for accessing non-struct members
This commit is contained in:
parent
45c38d5f88
commit
f6cb1a8c1d
@ -115,7 +115,7 @@ def expression(ctx: Context, inp: ourlang.Expression) -> ConstraintGenerator:
|
|||||||
if isinstance(inp, ourlang.AccessStructMember):
|
if isinstance(inp, ourlang.AccessStructMember):
|
||||||
assert isinstance(inp.struct_type3, type3types.Type3) # When does this happen?
|
assert isinstance(inp.struct_type3, type3types.Type3) # When does this happen?
|
||||||
st_args = prelude.struct.did_construct(inp.struct_type3)
|
st_args = prelude.struct.did_construct(inp.struct_type3)
|
||||||
assert st_args is not None # When does this happen?
|
assert st_args is not None # FIXME: See test_struct.py::test_struct_not_accessible
|
||||||
|
|
||||||
yield from expression(ctx, inp.varref)
|
yield from expression(ctx, inp.varref)
|
||||||
yield SameTypeConstraint(st_args[inp.member], inp.type3,
|
yield SameTypeConstraint(st_args[inp.member], inp.type3,
|
||||||
|
|||||||
@ -100,3 +100,15 @@ class f32:
|
|||||||
|
|
||||||
with pytest.raises(StaticError, match='f32 already defined as type'):
|
with pytest.raises(StaticError, match='f32 already defined as type'):
|
||||||
Suite(code_py).run_code()
|
Suite(code_py).run_code()
|
||||||
|
|
||||||
|
@pytest.mark.integration_test
|
||||||
|
@pytest.mark.skip(reason='FIXME: See constraintgenerator.py for AccessStructMember')
|
||||||
|
def test_struct_not_accessible():
|
||||||
|
code_py = """
|
||||||
|
@exported
|
||||||
|
def testEntry(x: u8) -> u8:
|
||||||
|
return x.y
|
||||||
|
"""
|
||||||
|
|
||||||
|
with pytest.raises(Type3Exception, match='u8 is not struct'):
|
||||||
|
Suite(code_py).run_code()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user