protected-t1010.scala
来自「JAVA 语言的函数式编程扩展」· SCALA 代码 · 共 28 行
SCALA
28 行
/** Check protected accessors involving polymorphic methods. */package pkg2 {trait PresentationsX extends pkg1.Presentations { trait ProjectImpl extends super.ProjectImpl { trait FileImpl extends super.FileImpl { lockTyper(Console.println) } }}} // pkg2package pkg1 {trait Presentations { trait ProjectImpl { trait FileImpl protected def lockTyper[T](f : => T) = { if (this == null) None else Some(f) } }}} // pkg1
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?