From aaab24dcf802ae2a15e346693dc73224de49ba11 Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Sun, 1 Sep 2019 22:45:06 +0300 Subject: [PATCH] use &Foo instead of *Foo warning --- compiler/parser.v | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/compiler/parser.v b/compiler/parser.v index 8f34337ad5..4e741c739d 100644 --- a/compiler/parser.v +++ b/compiler/parser.v @@ -742,6 +742,10 @@ if p.scanner.line_comment != '' { } } +fn (p mut Parser) warn(s string) { + println('$p.scanner.file_path:${p.scanner.line_nr+1}: $s') +} + fn (p mut Parser) error(s string) { // Dump all vars and types for debugging if p.pref.is_debug { @@ -863,6 +867,7 @@ fn (p mut Parser) get_type() string { } // for p.tok == .mul { + p.warn('use `&Foo` instead of `*Foo`') mul = true nr_muls++ p.check(.mul)