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

vfmt: fmt '!(a in/is b)' to 'a !in/is b' (#11335)

This commit is contained in:
yuyi
2021-08-30 14:45:36 +08:00
committed by GitHub
parent 61ac7b671d
commit f44eb88a8d
6 changed files with 59 additions and 5 deletions

View File

@ -0,0 +1,17 @@
struct Foo1 {}
struct Foo2 {}
type Foo = Foo1 | Foo2
fn main() {
a := [1, 2, 3]
if 4 !in a {
println('4 not in a')
}
foo := Foo(Foo1{})
if foo !is Foo2 {
println('foo is not Foo2')
}
}

View File

@ -0,0 +1,17 @@
struct Foo1{}
struct Foo2{}
type Foo = Foo1 | Foo2
fn main() {
a := [1, 2, 3]
if !(4 in a) {
println('4 not in a')
}
foo := Foo(Foo1{})
if !(foo is Foo2) {
println('foo is not Foo2')
}
}