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

checker: remove unecessary assert (#9617)

This commit is contained in:
Enzo 2021-04-07 19:18:18 +02:00 committed by GitHub
parent a747651f18
commit 9541eb816b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3577,7 +3577,6 @@ fn (mut c Checker) assert_stmt(node ast.AssertStmt) {
fn (mut c Checker) block(node ast.Block) {
if node.is_unsafe {
assert !c.inside_unsafe
c.inside_unsafe = true
c.stmts(node.stmts)
c.inside_unsafe = false
@ -5275,10 +5274,6 @@ pub fn (mut c Checker) lock_expr(mut node ast.LockExpr) ast.Type {
}
pub fn (mut c Checker) unsafe_expr(mut node ast.UnsafeExpr) ast.Type {
// assert !c.inside_unsafe
if c.inside_unsafe {
c.error('unsafe inside unsafe', node.pos)
}
c.inside_unsafe = true
t := c.expr(node.expr)
c.inside_unsafe = false