diff --git a/vlib/v/fmt/fmt.v b/vlib/v/fmt/fmt.v index 5876221b7a..cf66fc1d9a 100644 --- a/vlib/v/fmt/fmt.v +++ b/vlib/v/fmt/fmt.v @@ -592,6 +592,11 @@ fn (f mut Fmt) expr(node ast.Expr) { f.write('}') } } + ast.TypeOf { + f.write('typeof(') + f.expr(it.expr) + f.write(')') + } else { eprintln('fmt expr: unhandled node ' + typeof(node)) } diff --git a/vlib/v/fmt/tests/typeof_keep.vv b/vlib/v/fmt/tests/typeof_keep.vv new file mode 100644 index 0000000000..e42ded93b4 --- /dev/null +++ b/vlib/v/fmt/tests/typeof_keep.vv @@ -0,0 +1,3 @@ +fn test_typeof() { + println(typeof(x)) +}