diff options
author | Rico Tzschichholz <ricotz@ubuntu.com> | 2017-08-26 17:45:10 +0200 |
---|---|---|
committer | Rico Tzschichholz <ricotz@ubuntu.com> | 2017-09-02 20:37:03 +0200 |
commit | 652e01344d6adcb9d947ec75402561caa7efcb46 (patch) | |
tree | d98b2821715faa85dca88e743828d9757fb5b7df /vala/valasemanticanalyzer.vala | |
parent | 95a4c5568a9afd54ab1684468994fc75d76e43ba (diff) | |
download | vala-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/valasemanticanalyzer.vala')
-rw-r--r-- | vala/valasemanticanalyzer.vala | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/vala/valasemanticanalyzer.vala b/vala/valasemanticanalyzer.vala index 44b75f968..32a8d2d28 100644 --- a/vala/valasemanticanalyzer.vala +++ b/vala/valasemanticanalyzer.vala @@ -552,12 +552,12 @@ public class Vala.SemanticAnalyzer : CodeVisitor { if (arg.target_type != null) { if ((direction == ParameterDirection.IN || direction == ParameterDirection.REF) && !arg.value_type.compatible (arg.target_type)) { - Report.error (arg.source_reference, "Argument %d: Cannot convert from `%s' to `%s'".printf (i + 1, arg.value_type.to_string (), arg.target_type.to_string ())); + Report.error (arg.source_reference, "Argument %d: Cannot convert from `%s' to `%s'".printf (i + 1, arg.value_type.to_prototype_string (), arg.target_type.to_prototype_string ())); return false; } else if ((direction == ParameterDirection.REF || direction == ParameterDirection.OUT) && !arg.target_type.compatible (arg.value_type) && !(arg is NullLiteral)) { - Report.error (arg.source_reference, "Argument %d: Cannot convert from `%s' to `%s'".printf (i + 1, arg.target_type.to_string (), arg.value_type.to_string ())); + Report.error (arg.source_reference, "Argument %d: Cannot convert from `%s' to `%s'".printf (i + 1, arg.target_type.to_prototype_string (), arg.value_type.to_prototype_string ())); return false; } } |