1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

compiler: rename cerror() to verror(); some small optimizations

This commit is contained in:
Alexander Medvednikov
2019-09-24 00:40:34 +03:00
parent 3317d7fd7c
commit 55d09d23b4
11 changed files with 55 additions and 55 deletions

View File

@@ -935,12 +935,12 @@ fn (p mut Parser) fn_call_args(f mut Fn) &Fn {
// Add `&` or `*` before an argument?
if !is_interface {
// Dereference
if got.contains('*') && !expected.contains('*') {
if got.ends_with('*') && !expected.ends_with('*') {
p.cgen.set_placeholder(ph, '*')
}
// Reference
// TODO ptr hacks. DOOM hacks, fix please.
if !got.contains('*') && expected.contains('*') && got != 'voidptr' {
if !got.ends_with('*') && expected.ends_with('*') && got != 'voidptr' {
// Special case for mutable arrays. We can't `&` function results,
// have to use `(array[]){ expr }` hack.
if expected.starts_with('array_') && expected.ends_with('*') {