fmt: change `[1,2,3]!!` to `[1,2,3]!` (#8081)

pull/8082/head
yuyi 2021-01-13 15:32:17 +08:00 committed by GitHub
parent ac85257ea0
commit 7458b699d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 4 additions and 4 deletions

View File

@ -68,7 +68,7 @@ fn (context Context) file2v(bname string, fbytes []byte, bn_max int) string {
sb.write('$b, ') sb.write('$b, ')
} }
} }
sb.write(']!!\n') sb.write(']!\n')
return sb.str() return sb.str()
} }

View File

@ -2049,7 +2049,7 @@ pub fn (mut f Fmt) array_init(it ast.ArrayInit) {
// `[100]byte` // `[100]byte`
if it.is_fixed { if it.is_fixed {
if it.has_val { if it.has_val {
f.write('!!') f.write('!')
return return
} }
f.write(f.table.type_to_str(it.elem_type)) f.write(f.table.type_to_str(it.elem_type))

View File

@ -1,5 +1,5 @@
fn foo() [1]f32 { fn foo() [1]f32 {
return [f32(0.0)]!! return [f32(0.0)]!
} }
fn main() { fn main() {

View File

@ -1,3 +1,3 @@
fn test_typeof() { fn test_typeof() {
println(typeof(x)) println(typeof(x).name)
} }