fmt: AnonFn with body is not single line (#7659)

pull/7668/head
Lukas Neubert 2020-12-28 19:27:27 +01:00 committed by GitHub
parent 2360762a42
commit cf441091f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 0 deletions

View File

@ -1723,6 +1723,11 @@ fn stmt_is_single_line(stmt ast.Stmt) bool {
fn expr_is_single_line(expr ast.Expr) bool {
match expr {
ast.AnonFn {
if !expr.decl.no_body {
return false
}
}
ast.IfExpr {
return false
}

View File

@ -35,6 +35,12 @@ fn main() {
f: 'here'
}
)
ui.button(
width: 70
onclick: fn (a voidptr, b voidptr) {
webview.new_window(url: 'https://vlang.io', title: 'The V programming language')
}
)
}
fn bar_func(bar Bar) {