Why does this Kotlin method have enclosing backticks?

前端 未结 5 1990
感情败类
感情败类 2020-11-27 06:16

What are the backticks used for in the snippet below?

Why add them around the fun is(amount:Int ):Boolean { ... }?

verifier.`is`(amount         


        
5条回答
  •  一向
    一向 (楼主)
    2020-11-27 06:36

    is in list of Kotlin reserved words To use Kotlin reserved word (such as is or object) for function/class name you should wrap it to backticks

提交回复
热议问题