Do I need a trailing semicolon to disambiguate this code?

前端 未结 3 1973
攒了一身酷
攒了一身酷 2021-01-20 09:52

If I omit the semicolon, this code doesn\'t compile.

def checkRadioButton(xml: DslBuilder): String => XmlTree = {
    val inputs = top(xml).\\\\*(hasLocal         


        
3条回答
  •  借酒劲吻你
    2021-01-20 10:20

    I’d write it like this instead:

    def checkRadioButton(xml: DslBuilder): String => XmlTree = {
        val inputs = top(xml).\\*(hasLocalNameX("input"));
        (buttonValue: String) => { // <-- changed position of {
          // code omitted
        }
    }
    

提交回复
热议问题