Adds a separte typing system #3

Closed
jbwdevries wants to merge 18 commits from milner_type_checking into master
2 changed files with 2 additions and 1 deletions
Showing only changes of commit 2d0daf4b90 - Show all commits

View File

@ -621,6 +621,7 @@ class OurVisitor:
varref: Union[ModuleConstantReference, VariableReference] varref: Union[ModuleConstantReference, VariableReference]
if node.value.id in our_locals: if node.value.id in our_locals:
param = our_locals[node.value.id] param = our_locals[node.value.id]
node_typ = param.type
varref = VariableReference(param.type, param) varref = VariableReference(param.type, param)
elif node.value.id in module.constant_defs: elif node.value.id in module.constant_defs:
constant_def = module.constant_defs[node.value.id] constant_def = module.constant_defs[node.value.id]

View File

@ -27,5 +27,5 @@ def func_call() -> i{type_}:
""" """
ast = phasm_parse(code_py) ast = phasm_parse(code_py)
with pytest.raises(TypingError, match='Signed does not matchq'): with pytest.raises(TypingError, match='Signed does not match'):
phasm_type(ast) phasm_type(ast)