Skip to content

Instantly share code, notes, and snippets.

@kmizu
Created May 8, 2010 13:02
Show Gist options
  • Save kmizu/394552 to your computer and use it in GitHub Desktop.
Save kmizu/394552 to your computer and use it in GitHub Desktop.
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