Bystroushaak / tinySelf

Self-like language implemented in the RPython language toolkit.
29 stars 3 forks source link

Multiple slots with same name should require resend #34

Closed Bystroushaak closed 5 years ago

Bystroushaak commented 6 years ago

Test:

def test_multiple_parent_slots_raise_exception():
    ast = lex_and_parse("""(|
        p* = (| xex = 1. |).
        q* = (| xex = 2. |).

        fetchXex = (|| xex)
    |) fetchXex""")

    context = ast[0].compile(CodeContext())
    interpreter = Interpreter(universe=get_primitives())

    with raises(ValueError):
        interpreter.interpret(context)