W3C home > Mailing lists > Public > public-script-coord@w3.org > October to December 2013

Re: Figuring out easier readonly interfaces

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Wed, 2 Oct 2013 18:11:06 -0700
Message-ID: <CAAWBYDDw+rc5icqCu9QLPdGH409CJdSNhf56hFXOM4JXKScR2Q@mail.gmail.com>
To: "Mark S. Miller" <erights@google.com>
Cc: Boris Zbarsky <bzbarsky@mit.edu>, "public-script-coord@w3.org" <public-script-coord@w3.org>
On Wed, Oct 2, 2013 at 6:08 PM, Mark S. Miller <erights@google.com> wrote:
> If Foo is a subtype of Bar and you pass a Bar to a function that takes a
> Foo, what should happen?

This is passing a supertype instance to a method that expects a
subtype instance.  Ideally, it should work as long as you only use
parts that exist in the supertype.

> I ask because Foo is a almost an LSP subtype of readonly<Foo>. The LSP
> common supertype of Foo and readonly<Foo> has exactly the signature of
> readonly<Foo>.

Yes.

~TJ
Received on Thursday, 3 October 2013 01:11:52 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:14:18 UTC