diff --git a/artiq/compiler/transforms/artiq_ir_generator.py b/artiq/compiler/transforms/artiq_ir_generator.py index b0ce78c91..a822f8815 100644 --- a/artiq/compiler/transforms/artiq_ir_generator.py +++ b/artiq/compiler/transforms/artiq_ir_generator.py @@ -186,7 +186,7 @@ class ARTIQIRGenerator(algorithm.Visitor): optargs.append(ir.Argument(ir.TOption(typ.optargs[arg_name]), "arg." + arg_name)) func = ir.Function(typ, ".".join(self.name), [env_arg] + args + optargs, - loc=node.keyword_loc) + loc=node.lambda_loc if is_lambda else node.keyword_loc) func.is_internal = is_internal self.functions.append(func) old_func, self.current_function = self.current_function, func diff --git a/artiq/compiler/transforms/inferencer.py b/artiq/compiler/transforms/inferencer.py index a256f9775..0fe000189 100644 --- a/artiq/compiler/transforms/inferencer.py +++ b/artiq/compiler/transforms/inferencer.py @@ -728,7 +728,7 @@ class Inferencer(algorithm.Visitor): elif keyword.arg in typ.optargs: self._unify(keyword.value.type, typ.optargs[keyword.arg], keyword.value.loc, None) - passed_args.add(keyword.arg) + passed_args[keyword.arg] = keyword.arg_loc for formalname in typ.args: if formalname not in passed_args: diff --git a/artiq/compiler/transforms/llvm_ir_generator.py b/artiq/compiler/transforms/llvm_ir_generator.py index 4eaf34e68..4fd341763 100644 --- a/artiq/compiler/transforms/llvm_ir_generator.py +++ b/artiq/compiler/transforms/llvm_ir_generator.py @@ -403,7 +403,7 @@ class LLVMIRGenerator: finally: self.llfunction = None self.llmap = {} - self.llphis = [] + self.phis = [] def process_Phi(self, insn): llinsn = self.llbuilder.phi(self.llty_of_type(insn.type), name=insn.name) diff --git a/lit-test/test/inferencer/error_builtin_calls.py b/lit-test/test/inferencer/error_builtin_calls.py index 32ce8b294..8eab7a203 100644 --- a/lit-test/test/inferencer/error_builtin_calls.py +++ b/lit-test/test/inferencer/error_builtin_calls.py @@ -11,5 +11,5 @@ len(1) # CHECK-L: ${LINE:+1}: error: the argument of list() must be of an iterable type list(1) -# CHECK-L: ${LINE:+1}: error: an argument of range() must be of a numeric type +# CHECK-L: ${LINE:+1}: error: an argument of range() must be of an integer type range([]) diff --git a/lit-test/test/inferencer/error_call.py b/lit-test/test/inferencer/error_call.py index 21ba5bdf6..739ffa249 100644 --- a/lit-test/test/inferencer/error_call.py +++ b/lit-test/test/inferencer/error_call.py @@ -13,7 +13,7 @@ f(*[]) # CHECK-L: ${LINE:+1}: error: variadic arguments are not supported f(**[]) -# CHECK-L: ${LINE:+1}: error: the argument 'x' is already passed +# CHECK-L: ${LINE:+1}: error: the argument 'x' has been passed earlier as positional f(1, x=1) # CHECK-L: ${LINE:+1}: error: mandatory argument 'x' is not passed