groostav
02/01/2017, 6:03 AMinterface Node {}
class NodeImpl1: Node {}
class NodeImpl2: Node {}
interface NodeVisitor {
fun visit(n: NodeImpl1): Unit = TODO();
fun visit(n: NodeImpl2): Unit = TODO();
}
fun <T: Node> T.accept(visitor: NodeVisitor){
visitor.visit(this)
}