forked from M-Labs/artiq
1
0
Fork 0

compiler.embedding: default RPC return annotation is -> TNone.

This commit is contained in:
whitequark 2015-09-01 08:38:38 -06:00
parent c9d8fd837e
commit 995245b786
3 changed files with 2 additions and 21 deletions

View File

@ -595,12 +595,7 @@ class Stitcher:
ret_type = self._extract_annot(function, signature.return_annotation, ret_type = self._extract_annot(function, signature.return_annotation,
"return type", loc, is_syscall=syscall is not None) "return type", loc, is_syscall=syscall is not None)
elif syscall is None: elif syscall is None:
diag = diagnostic.Diagnostic("error", ret_type = builtins.TNone()
"function must have a return type annotation to be called remotely", {},
self._function_loc(function),
notes=self._call_site_note(loc, is_syscall=False))
self.engine.process(diag)
ret_type = types.TVar()
else: # syscall is not None else: # syscall is not None
diag = diagnostic.Diagnostic("error", diag = diagnostic.Diagnostic("error",
"system call must have a return type annotation", {}, "system call must have a return type annotation", {},

View File

@ -12,7 +12,7 @@ class Roundtrip(EnvExperiment):
class RoundtripTest(ExperimentCase): class RoundtripTest(ExperimentCase):
def assertRoundtrip(self, obj): def assertRoundtrip(self, obj):
exp = self.create(Roundtrip) exp = self.create(Roundtrip)
def callback(objcopy) -> TNone: def callback(objcopy):
self.assertEqual(obj, objcopy) self.assertEqual(obj, objcopy)
exp.roundtrip(obj, callback) exp.roundtrip(obj, callback)

View File

@ -1,14 +0,0 @@
# RUN: %python -m artiq.compiler.testbench.embedding %s >%t
# RUN: OutputCheck %s --file-to-check=%t
from artiq.language.core import *
from artiq.language.types import *
# CHECK-L: ${LINE:+1}: error: function must have a return type annotation to be called remotely
def foo():
pass
@kernel
def entrypoint():
# CHECK-L: ${LINE:+1}: note: in function called remotely here
foo()