diff options
author | Rico Tzschichholz <ricotz@ubuntu.com> | 2016-12-08 13:30:10 +0100 |
---|---|---|
committer | Rico Tzschichholz <ricotz@ubuntu.com> | 2016-12-10 12:51:27 +0100 |
commit | eda719e54762a41fece37dee835f177ef338a431 (patch) | |
tree | dace65f333f0a2e40f9a96ab48882f320b819545 /codegen | |
parent | 03a2baee6383c2b14542719734ed4e3a6376b709 (diff) | |
download | vala-eda719e54762a41fece37dee835f177ef338a431.tar.gz |
vala: Check inferred generic-types of MemberAccess
Although avoid this check for simple-generic accesses where this would be
too strict and not wanted.
https://bugzilla.gnome.org/show_bug.cgi?id=775466
Diffstat (limited to 'codegen')
-rw-r--r-- | codegen/valaccodebasemodule.vala | 7 | ||||
-rw-r--r-- | codegen/valaccodemethodcallmodule.vala | 5 |
2 files changed, 12 insertions, 0 deletions
diff --git a/codegen/valaccodebasemodule.vala b/codegen/valaccodebasemodule.vala index 4898a5f13..1b9856c48 100644 --- a/codegen/valaccodebasemodule.vala +++ b/codegen/valaccodebasemodule.vala @@ -4427,6 +4427,13 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator { } } + public void check_type_arguments (MemberAccess access) { + foreach (var type_arg in access.get_type_arguments ()) { + check_type (type_arg); + check_type_argument (type_arg); + } + } + void check_type_argument (DataType type_arg) { if (type_arg is GenericType || type_arg is PointerType diff --git a/codegen/valaccodemethodcallmodule.vala b/codegen/valaccodemethodcallmodule.vala index 31e1839e6..dce947f91 100644 --- a/codegen/valaccodemethodcallmodule.vala +++ b/codegen/valaccodemethodcallmodule.vala @@ -44,6 +44,11 @@ public class Vala.CCodeMethodCallModule : CCodeAssignmentModule { if (itype is MethodType) { assert (ma != null); m = ((MethodType) itype).method_symbol; + + if (!get_ccode_simple_generics (m)) { + check_type_arguments (ma); + } + if (ma.inner != null && ma.inner.value_type is EnumValueType && ((EnumValueType) ma.inner.value_type).get_to_string_method() == m) { // Enum.VALUE.to_string() var en = (Enum) ma.inner.value_type.data_type; |