bug663.scala

来自「JAVA 语言的函数式编程扩展」· SCALA 代码 · 共 19 行

SCALA
19
字号
package test;trait Test {  type Matchable <: Node with MatchableImpl;  trait MatchableImpl extends NodeImpl {    def asMatch(node : Matchable) : Any;  }  type Node <: NodeImpl;  trait NodeImpl;  trait CoreIfImpl extends MatchableImpl {    // NO_CRASH: def asMatch(m : Matchable) = {    def asMatch(m : Node) : Any = {      if (m.isInstanceOf[MatchableImpl]) {        null;      } else null;      // NO_CRASH: null;    }  }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?