predef

Scala Predef unimport [duplicate]

十年热恋 提交于 2019-12-04 00:40:32
问题 This question already has answers here : Closed 8 years ago . Possible Duplicate: How to unimport String “+” operator in Scala? So things from Predef get automatically imported into scala programs. But how can I disable- unimport certain or all imported functions from Predef? As an example if I don't like the '+' operator on String how to disable this functionality? 回答1: As mentioned in the linked answer, the method String#+(other: Any) is added to the String class with compiler magic, rather