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

Revert "parser: add error for typeof(T), suggesting typeof[T]() instead"

This reverts commit 692624b47c.
This commit is contained in:
Delyan Angelov 2023-06-06 12:03:55 +03:00
parent 692624b47c
commit c1e302a38d
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED
3 changed files with 0 additions and 13 deletions

View File

@ -223,9 +223,6 @@ fn (mut p Parser) check_expr(precedence int) !ast.Expr {
} }
} else { } else {
p.check(.lpar) p.check(.lpar)
if p.tok.kind == .name && p.tok.lit.len > 0 && p.tok.lit[0].is_capital() {
p.error_with_pos('use `typeof[T]()`, instead of `typeof(T)`', spos)
}
expr := p.expr(0) expr := p.expr(0)
p.check(.rpar) p.check(.rpar)
if p.tok.kind != .dot && p.tok.line_nr == p.prev_tok.line_nr { if p.tok.kind != .dot && p.tok.line_nr == p.prev_tok.line_nr {

View File

@ -1,5 +0,0 @@
vlib/v/parser/tests/typeof_typename_err.vv:1:29: error: use `typeof[T]()`, instead of `typeof(T)`
1 | fn f[T]() { println("type ${typeof(T)}") }
| ~~~~~~
2 | f[int]()
3 | f[string]()

View File

@ -1,5 +0,0 @@
fn f[T]() { println("type ${typeof(T)}") }
f[int]()
f[string]()