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

use &Foo instead of *Foo warning

This commit is contained in:
Alexander Medvednikov 2019-09-01 22:45:06 +03:00
parent 59ba551d3b
commit aaab24dcf8

View File

@ -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) { fn (p mut Parser) error(s string) {
// Dump all vars and types for debugging // Dump all vars and types for debugging
if p.pref.is_debug { if p.pref.is_debug {
@ -863,6 +867,7 @@ fn (p mut Parser) get_type() string {
} }
// //
for p.tok == .mul { for p.tok == .mul {
p.warn('use `&Foo` instead of `*Foo`')
mul = true mul = true
nr_muls++ nr_muls++
p.check(.mul) p.check(.mul)