mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
v.eval: support unsafe
expr (#16224)
This commit is contained in:
parent
ce2c732db8
commit
e6fad82b87
@ -526,12 +526,15 @@ pub fn (mut e Eval) expr(expr ast.Expr, expecting ast.Type) Object {
|
||||
|
||||
return res
|
||||
}
|
||||
ast.UnsafeExpr {
|
||||
return e.expr(expr.expr, expecting)
|
||||
}
|
||||
ast.AnonFn, ast.ArrayDecompose, ast.AsCast, ast.Assoc, ast.AtExpr, ast.CTempVar,
|
||||
ast.ChanInit, ast.Comment, ast.ComptimeCall, ast.ComptimeSelector, ast.ComptimeType,
|
||||
ast.ConcatExpr, ast.DumpExpr, ast.EmptyExpr, ast.EnumVal, ast.GoExpr, ast.IfGuardExpr,
|
||||
ast.IndexExpr, ast.IsRefType, ast.Likely, ast.LockExpr, ast.MapInit, ast.MatchExpr,
|
||||
ast.Nil, ast.NodeError, ast.None, ast.OffsetOf, ast.OrExpr, ast.RangeExpr, ast.SelectExpr,
|
||||
ast.SqlExpr, ast.TypeNode, ast.TypeOf, ast.UnsafeExpr {
|
||||
ast.SqlExpr, ast.TypeNode, ast.TypeOf {
|
||||
e.error('unhandled expression ${typeof(expr).name}')
|
||||
}
|
||||
}
|
||||
|
1
vlib/v/eval/testdata/unsafe_expr.out
vendored
Normal file
1
vlib/v/eval/testdata/unsafe_expr.out
vendored
Normal file
@ -0,0 +1 @@
|
||||
true
|
3
vlib/v/eval/testdata/unsafe_expr.vv
vendored
Normal file
3
vlib/v/eval/testdata/unsafe_expr.vv
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
unsafe {
|
||||
println(true)
|
||||
}
|
Loading…
Reference in New Issue
Block a user