<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
I have a question about your example. I'm not trying to be clever
and play "whatabout", I'm looking for a straight answer why you
think the two cases are different. <br>
<br>
<blockquote type="cite" cite="mid:1873318389.2133206.1662737744430.JavaMail.zimbra@u-pem.fr">
<div><span style="font-size: large;"><span style="font-family:
monospace;"><br data-mce-bogus="1">
</span></span></div>
<div><span style="font-size: large;"><span style="font-family:
monospace;">If we take a simple example<br data-mce-bogus="1">
</span></span></div>
<div><span style="font-size: large;"><span style="font-family:
monospace;"> record Point(int x, int y) { }<br data-mce-bogus="1">
</span></span></div>
<div><span style="font-size: large;"><span style="font-family:
monospace;"> Point point = ...<br data-mce-bogus="1">
</span></span></div>
<div><span style="font-size: large;"><span style="font-family:
monospace;"> switch(point) {<br data-mce-bogus="1">
</span></span></div>
<div><span style="font-size: large;"><span style="font-family:
monospace;"> case Point(int i, int j) -> ...<br data-mce-bogus="1">
</span></span></div>
<div><span style="font-size: large;"><span style="font-family:
monospace;"> ...<br data-mce-bogus="1">
</span></span></div>
<div><span style="font-size: large;"><span style="font-family:
monospace;"> }<br data-mce-bogus="1">
</span></span></div>
<div><span style="font-size: large;"><span style="font-family:
monospace;"><br data-mce-bogus="1">
</span></span></div>
<div><span style="font-size: large;"><span style="font-family:
monospace;">let say know that we change Point to use longs<br data-mce-bogus="1">
</span></span></div>
<div><span style="font-size: large;"><span style="font-family:
monospace;"> record Point(long x, long y) { }<br data-mce-bogus="1">
</span></span></div>
<div><span style="font-size: large;"><span style="font-family:
monospace;"><br data-mce-bogus="1">
</span></span></div>
<div><span style="font-size: large;"><span style="font-family:
monospace;">With the semantics you propose, the code still
compile but the pattern is now transformed to a partial
pattern that will not match all Points but only the ones
with x and y in between Integer.MIN_VALUE and
Integer.MAX_VALUE.</span></span></div>
</blockquote>
<br>
The same is true when I start with<br>
<br>
record Foo(String s) { ... }<br>
<br>
and later change it to<br>
<br>
record Foo(Object s) { ... }<br>
<br>
(both are incompatible changes, but we won't dwell on that.) <br>
<br>
My question is: why does it not bother you that use-site patterns
like `Foo(String s)` are reinterpreted as partial after the String
-> Object change, but the analogous change with long -> int
bothers you so much that you'd use it to argue against being able to
ask whether a long is also an int? <br>
<br>
You obviously think that these two examples are radically
different. Can you explain why? Is it anything more than "that's
the way its always been"? <br>
</body>
</html>