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:
@@ -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('*') {
|
||||
|
||||
Reference in New Issue
Block a user