Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

只要把布尔类型加到switch case里面就报错了,其他类型使用case .type(let value)都是正常的,就括号里包含布尔类型的时候报错了。给了'_' can only appear in a pattern or on the left side of an assignment的报错信息,有谁知道这个是什么情况吗?
还有这个现在要怎么写?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
1.4k views
Welcome To Ask or Share your Answers For Others

1 Answer

我把它们删掉之后按照报错提示,系统重新添加了这两项,然后就正常了,再次把它们放到原来的位置也没报错了,这个情况没遇到过,也不知道是什么情况。。明明是一样的代码。有谁知道原因吗。。。


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...