<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<p>It seems to me that such a linter would need to scan the entire
module to determine if a class is subclassed, provided that it is
internal. My understanding of linters is that they typically don't
do static analysis of this sort, they are more targeted at local
source or AST analysis. Whole module optimization already looks at
if an internal class is subclassed in order to do its work, so
presumably the same sort of analysis would be required which
suggests a compiler feature as I understand it.<br>
</p>
<br>
<div class="moz-cite-prefix">On 6/16/2016 4:32 PM, Saagar Jha via
swift-evolution wrote:<br>
</div>
<blockquote
cite="mid:CAPUQp73PnnwbkoJhFkMGP8SSwUQ3CeceTdSDy1YSo3wAOE8EKw@mail.gmail.com"
type="cite">
<div dir="ltr">I think that linters are the best way to handle
this. It’s not really a code smell that should always be taken
care of (which would indicate that the compiler should warn
about it), and as such should be relegated to the linter.<br>
<br>
<div class="gmail_quote">
<div dir="ltr">On Thu, Jun 16, 2016 at 10:08 AM Rehat Kathuria
via swift-evolution <<a moz-do-not-send="true"
href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>>
wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word">Agree with Sean that this
shouldn’t apply to classes declared public; I also don’t
think the "default by final” discussion ever came to a
consensus.
<div><br>
</div>
<div>As for linters, my understanding of them is that
they’re inclined to style-guides as opposed to
architectural suggestions.The declaration of a class
being final isn’t one that’s dependant on style, rather
architecture.</div>
</div>
<div style="word-wrap:break-word">
<div><br>
<div><br>
<div>
<blockquote type="cite">
<div>On 16 Jun 2016, at 17:57, Xiaodi Wu <<a
moz-do-not-send="true"
href="mailto:xiaodi.wu@gmail.com"
target="_blank"><a class="moz-txt-link-abbreviated" href="mailto:xiaodi.wu@gmail.com">xiaodi.wu@gmail.com</a></a>>
wrote:</div>
<br>
<div>
<div dir="ltr">
<div class="gmail_extra">
<div class="gmail_quote">On Thu, Jun 16,
2016 at 11:39 AM, L. Mihalkovic via
swift-evolution <span dir="ltr"><<a
moz-do-not-send="true"
href="mailto:swift-evolution@swift.org"
target="_blank"><a class="moz-txt-link-abbreviated" href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a></a>></span>
wrote:<br>
<blockquote class="gmail_quote"
style="margin:0 0 0 .8ex;border-left:1px
#ccc solid;padding-left:1ex">Likely a
lint level feature, no?</blockquote>
<div><br>
</div>
<div>Agreed. Sounds like a linter
feature. </div>
<div> </div>
<blockquote class="gmail_quote"
style="margin:0 0 0 .8ex;border-left:1px
#ccc solid;padding-left:1ex">
<div>
<div>
> On Jun 16, 2016, at 6:27 PM,
Sean Heber via swift-evolution <<a
moz-do-not-send="true"
href="mailto:swift-evolution@swift.org"
target="_blank"><a class="moz-txt-link-abbreviated" href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a></a>>
wrote:<br>
><br>
> I would think this would not
apply to public classes.<br>
><br>
> There has also been discussion
in the past about making final the
default - I don’t remember if that
ever resolved into some kind of
consensus or not, though.<br>
><br>
> l8r<br>
> Sean<br>
><br>
><br>
>> On Jun 16, 2016, at 11:23
AM, Saagar Jha via swift-evolution
<<a moz-do-not-send="true"
href="mailto:swift-evolution@swift.org"
target="_blank">swift-evolution@swift.org</a>>
wrote:<br>
>><br>
>> Correct me if I’m wrong,
but if you’re writing some kind of
framework and your class is not
final but never subclassed, you
wouldn’t want the warning, even if
you’d like to allow users to
subclass it?<br>
>><br>
>><br>
>><br>
>> On Thu, Jun 16, 2016 at
9:02 AM Rehat Kathuria via
swift-evolution <<a
moz-do-not-send="true"
href="mailto:swift-evolution@swift.org"
target="_blank"><a class="moz-txt-link-abbreviated" href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a></a>>
wrote:<br>
>> I’d like the compiler to
present a warning when a class not
declared as final is never
subclassed. Thoughts?<br>
>>
_______________________________________________<br>
>> swift-evolution mailing
list<br>
>> <a moz-do-not-send="true"
href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a><br>
>> <a moz-do-not-send="true"
href="https://lists.swift.org/mailman/listinfo/swift-evolution"
rel="noreferrer" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br>
>> --<br>
>> -Saagar Jha<br>
>>
_______________________________________________<br>
>> swift-evolution mailing
list<br>
>> <a moz-do-not-send="true"
href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a><br>
>> <a moz-do-not-send="true"
href="https://lists.swift.org/mailman/listinfo/swift-evolution"
rel="noreferrer" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br>
><br>
>
_______________________________________________<br>
> swift-evolution mailing list<br>
> <a moz-do-not-send="true"
href="mailto:swift-evolution@swift.org"
target="_blank">swift-evolution@swift.org</a><br>
> <a moz-do-not-send="true"
href="https://lists.swift.org/mailman/listinfo/swift-evolution"
rel="noreferrer" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br>
_______________________________________________<br>
swift-evolution mailing list<br>
<a moz-do-not-send="true"
href="mailto:swift-evolution@swift.org"
target="_blank">swift-evolution@swift.org</a><br>
<a moz-do-not-send="true"
href="https://lists.swift.org/mailman/listinfo/swift-evolution"
rel="noreferrer" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</div>
</div>
_______________________________________________<br>
swift-evolution mailing list<br>
<a moz-do-not-send="true"
href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a><br>
<a moz-do-not-send="true"
href="https://lists.swift.org/mailman/listinfo/swift-evolution"
rel="noreferrer" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br>
</blockquote>
</div>
</div>
<div dir="ltr">-- <br>
</div>
<div data-smartmail="gmail_signature">
<div dir="ltr">-Saagar Jha</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
swift-evolution mailing list
<a class="moz-txt-link-abbreviated" href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>
<a class="moz-txt-link-freetext" href="https://lists.swift.org/mailman/listinfo/swift-evolution">https://lists.swift.org/mailman/listinfo/swift-evolution</a>
</pre>
</blockquote>
<br>
</body>
</html>