Skip to content

Commit

Permalink
Fix ff3206b.
Browse files Browse the repository at this point in the history
whitequark committed Dec 30, 2015
1 parent ff3206b commit df91500
Showing 3 changed files with 6 additions and 4 deletions.
3 changes: 1 addition & 2 deletions artiq/compiler/embedding.py
Original file line number Diff line number Diff line change
@@ -394,8 +394,7 @@ def proxy_diagnostic(diag):
IntMonomorphizer(engine=proxy_engine).visit(ast)
attr_value_type = ast.type

if is_method:
assert types.is_function(attr_value_type)
if is_method and types.is_rpc_function(attr_value_type):
self_type = list(attr_value_type.args.values())[0]
self._unify(object_type, self_type,
node.loc, None)
5 changes: 4 additions & 1 deletion artiq/compiler/transforms/artiq_ir_generator.py
Original file line number Diff line number Diff line change
@@ -851,8 +851,11 @@ def visit_AttributeT(self, node):
if self.current_assign is None:
return self.append(ir.GetAttr(obj, node.attr,
name="{}.{}".format(_readable_name(obj), node.attr)))
elif types.is_rpc_function(self.current_assign.type):
# RPC functions are just type-level markers
return self.append(ir.Builtin("nop", [], builtins.TNone()))
else:
self.append(ir.SetAttr(obj, node.attr, self.current_assign))
return self.append(ir.SetAttr(obj, node.attr, self.current_assign))

def _map_index(self, length, index, one_past_the_end=False, loc=None):
lt_0 = self.append(ir.Compare(ast.Lt(loc=None),
2 changes: 1 addition & 1 deletion artiq/compiler/validators/monomorphism.py
Original file line number Diff line number Diff line change
@@ -28,7 +28,7 @@ def generic_visit(self, node):
super().generic_visit(node)

if isinstance(node, asttyped.commontyped):
if types.is_polymorphic(node.type):
if types.is_polymorphic(node.type) and not types.is_rpc_function(node.type):
note = diagnostic.Diagnostic("note",
"the expression has type {type}",
{"type": types.TypePrinter().name(node.type)},

0 comments on commit df91500

Please sign in to comment.