-
-
Save Epictetus/3897156 to your computer and use it in GitHub Desktop.
Wrong example of proteted
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Node { | |
def eval(other: Node): Unit = other.protected_method(this) | |
protected def protected_method(other: Node) = other | |
} | |
class NodeFake(node: Node) extends Node { | |
override def eval(other: Node): Unit = { | |
println("pre") | |
println(this == other.protected_method(this)) | |
println("pre") | |
} | |
} | |
new NodeFake(new Node()).eval(new Node()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment