<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Mar 27, 2020, at 1:55 PM, David Blaikie <<a href="mailto:dblaikie@gmail.com" class="">dblaikie@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><blockquote class="gmail_quote" style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;">That's why I'm also wary of the idea of just having use lists empty<br class="">for certain types without any other special handling. However, I would<br class="">argue that if Value::use_begin() etc. contain an assertion that fails<br class="">when called on one of the value types that don't have use lists, then<br class="">the Liskov substition principle is de facto not broken. It basically<br class="">leads to a situation that is as-if Value didn't have use lists in the<br class="">first place, and only certain sub-types had use lists.<br class=""></blockquote><div style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><br class="">But it doesn't - it means you write some generic code, test it with some cases & looks like it generalizes to other cases (you don't want to/can't test generic code with all possible generic arguments - that's why substitutability is important) then the code breaks when it hits a constant Value because it doesn't conform to the contract.<br class=""></div></div></blockquote><br class=""></div><div>David is exactly right.  To say the same thing in another way, such a design point would break library based design, one of the core principles of LLVM that makes it so powerful.  </div><div><br class=""></div><div>To make this explicit, a library that walks use-lists internally would have implicit dependencies in its APIs that some things are not allowed to be constants.</div><div><br class=""></div><div>-Chris</div></body></html>