Created
May 8, 2010 13:02
-
-
Save kmizu/394552 to your computer and use it in GitHub Desktop.
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 SuperA | |
def foo(): String | |
"SuperA#foo()" | |
end | |
end | |
class SuperB | |
def foo(): String | |
"SuperB#foo()" | |
end | |
end | |
class Sub extends SuperA, SuperB | |
rename SuperA.foo as foo2 | |
end | |
# use SuperA | |
a: SuperA = SuperA.new | |
a.foo() # => SuperA#foo() | |
# substitute Sub for SuperA | |
# a: Sub = Sub.new | |
# a.foo() # => SuperB#foo() LSP violation ? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment