summaryrefslogtreecommitdiff
path: root/vala/valamethodtype.vala
diff options
context:
space:
mode:
authorRico Tzschichholz <ricotz@ubuntu.com>2017-08-26 17:45:10 +0200
committerRico Tzschichholz <ricotz@ubuntu.com>2017-09-02 20:37:03 +0200
commit652e01344d6adcb9d947ec75402561caa7efcb46 (patch)
treed98b2821715faa85dca88e743828d9757fb5b7df /vala/valamethodtype.vala
parent95a4c5568a9afd54ab1684468994fc75d76e43ba (diff)
downloadvala-652e01344d6adcb9d947ec75402561caa7efcb46.tar.gz
Improve error while method is incompatible with delegate
Add virtual DataType.to_prototype_string() and use a common implementation in CallableType for its descendents.
Diffstat (limited to 'vala/valamethodtype.vala')
-rw-r--r--vala/valamethodtype.vala41
1 files changed, 0 insertions, 41 deletions
diff --git a/vala/valamethodtype.vala b/vala/valamethodtype.vala
index 1cf9a5857..2f2894e85 100644
--- a/vala/valamethodtype.vala
+++ b/vala/valamethodtype.vala
@@ -72,45 +72,4 @@ public class Vala.MethodType : CallableType {
}
return null;
}
-
- public string to_prototype_string (bool with_type_parameters = false) {
- var proto = "%s %s (".printf (get_return_type ().to_string (), this.to_string ());
-
- int i = 1;
- foreach (Parameter param in get_parameters ()) {
- if (i > 1) {
- proto += ", ";
- }
-
- if (param.ellipsis) {
- proto += "...";
- continue;
- }
-
- if (param.direction == ParameterDirection.IN) {
- if (param.variable_type.value_owned) {
- proto += "owned ";
- }
- } else {
- if (param.direction == ParameterDirection.REF) {
- proto += "ref ";
- } else if (param.direction == ParameterDirection.OUT) {
- proto += "out ";
- }
- if (param.variable_type.is_weak ()) {
- proto += "unowned ";
- }
- }
-
- proto = "%s%s %s".printf (proto, param.variable_type.to_qualified_string (), param.name);
-
- if (param.initializer != null) {
- proto = "%s = %s".printf (proto, param.initializer.to_string ());
- }
-
- i++;
- }
-
- return proto + ")";
- }
}