报告当前文件中未启用的高级语言功能的用法。
高级语言功能需要通过相应的编译器选项或通过在使用它们的文件中导入显式功能标志来启用。
后缀运算符表示法:
val s = 123 toString
反射调用:
def foo(v: {def bar()}) = v.bar()
动态成员选择:
class Foo extends Dynamic
隐式转换:
implicit def toInt(s: String) = s.toInt
高阶类型(自 Scala 2.13.1 起默认启用):
class Bar[M[A]]
存在类型:
def foo(v: Seq[T] forSome { type T })
宏定义:
def assert(s: String) = macro Asserts.assertImpl
当提供 "-feature" 选项时,Scala 编译器也可能会发出这些警告。
有关编译器选项,请参阅:项目设置 | 编译器 | Scala 编译器 | 功能