forked from M-Labs/artiq
embedding: unify all derived attribute types.
This commit is contained in:
parent
f52d364806
commit
6938036b28
|
@ -402,9 +402,12 @@ class StitchingInferencer(Inferencer):
|
||||||
if node.attr not in attributes:
|
if node.attr not in attributes:
|
||||||
# We just figured out what the type should be. Add it.
|
# We just figured out what the type should be. Add it.
|
||||||
attributes[node.attr] = attr_value_type
|
attributes[node.attr] = attr_value_type
|
||||||
elif attributes[node.attr] != attr_value_type and not types.is_rpc_function(attr_value_type):
|
elif not types.is_rpc_function(attr_value_type):
|
||||||
# Does this conflict with an earlier guess?
|
# Does this conflict with an earlier guess?
|
||||||
# RPC function types are exempt because RPCs are dynamically typed.
|
# RPC function types are exempt because RPCs are dynamically typed.
|
||||||
|
try:
|
||||||
|
attributes[node.attr].unify(attr_value_type)
|
||||||
|
except types.UnificationError as e:
|
||||||
printer = types.TypePrinter()
|
printer = types.TypePrinter()
|
||||||
diag = diagnostic.Diagnostic("error",
|
diag = diagnostic.Diagnostic("error",
|
||||||
"host object has an attribute '{attr}' of type {typea}, which is"
|
"host object has an attribute '{attr}' of type {typea}, which is"
|
||||||
|
|
Loading…
Reference in New Issue