Comment #0 by qs.il.paperinik — 2021-02-01T20:49:05Z
interface SinkString
{
void toString(void delegate(string) sink);
}
class Aggregate : SinkString
{
override void toString(void delegate(string) @safe sink) @safe
{
sink("I'm an Aggreate!");
}
}
Here, void delegate(string) @safe is not a super-type of void delegate(string) which it would need to be to be sound by the Liskov substitution principle. To the contrary, it allows passing @system `sink`s to an Aggregate object through a SinkString reference.
Comment #1 by razvan.nitu1305 — 2021-02-02T11:29:41Z