summaryrefslogtreecommitdiff
path: root/codegen
diff options
context:
space:
mode:
authorRico Tzschichholz <ricotz@ubuntu.com>2021-08-06 08:40:31 +0200
committerRico Tzschichholz <ricotz@ubuntu.com>2021-08-06 08:41:47 +0200
commit453c81d3844ec7ea8ec8dfbcd52346e2c3a24cf7 (patch)
treec3e259baf9dbc35b75d2bd6bd2f56b6b3831832c /codegen
parent7ebb25ffa2226a8a098b8b1ea2cef64d1015b4de (diff)
downloadvala-453c81d3844ec7ea8ec8dfbcd52346e2c3a24cf7.tar.gz
Slightly improve source_reference for get_dup_func_expression()
Diffstat (limited to 'codegen')
-rw-r--r--codegen/valaccodebasemodule.vala4
-rw-r--r--codegen/valagtypemodule.vala2
2 files changed, 3 insertions, 3 deletions
diff --git a/codegen/valaccodebasemodule.vala b/codegen/valaccodebasemodule.vala
index 0c79686de..54fc3e184 100644
--- a/codegen/valaccodebasemodule.vala
+++ b/codegen/valaccodebasemodule.vala
@@ -3083,7 +3083,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
}
} else {
// duplicating non-reference counted objects may cause side-effects (and performance issues)
- Report.error (source_reference, "duplicating %s instance, use unowned variable or explicitly invoke copy method", type.type_symbol.name);
+ Report.error (source_reference, "duplicating `%s' instance, use unowned variable or explicitly invoke copy method", type.type_symbol.name);
return new CCodeInvalidExpression();
}
@@ -4919,7 +4919,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
arg_map.set (get_param_pos (0.1 * type_param_index + 0.02), get_type_id_expression (type_arg, is_chainup));
if (requires_copy (type_arg)) {
- var dup_func = get_dup_func_expression (type_arg, type_arg.source_reference, is_chainup);
+ var dup_func = get_dup_func_expression (type_arg, type_arg.source_reference ?? expr.source_reference, is_chainup);
if (dup_func == null) {
// type doesn't contain a copy function
expr.error = true;
diff --git a/codegen/valagtypemodule.vala b/codegen/valagtypemodule.vala
index 3a6e3f4f1..95e49c56a 100644
--- a/codegen/valagtypemodule.vala
+++ b/codegen/valagtypemodule.vala
@@ -1478,7 +1478,7 @@ public class Vala.GTypeModule : GErrorModule {
add_generic_accessor_function ("get_%s".printf (get_ccode_copy_function (p)),
"GBoxedCopyFunc",
- get_dup_func_expression (p_data_type, null),
+ get_dup_func_expression (p_data_type, p_data_type.source_reference),
p, cl, iface);
add_generic_accessor_function ("get_%s".printf (get_ccode_destroy_function (p)),